[转载] #CheckBox expand its click area ##CheckBox扩大点击区域
来源:互联网 发布:万物生长齐溪好丑 知乎 编辑:程序博客网 时间:2024/05/01 21:11
原文:http://blog.csdn.net/ws10052797/article/details/52924876
Method
1 用”android:drawableLeft“取代”android:background”来设置CheckBox的自定义样式;同时自身设置”android:text”来显示文字提示,取代CheckBox+TextView的模式.
具体代码见原文
2 使用TouchDelegate, 引用自 link text.
I asked a friend at Google and they were able to help me figure out how to use TouchDelegate. Here’s what we came up with:
final View parent = (View) delegate.getParent();parent.post( new Runnable() {// Post in the parent's message queue to make sure the parent// lays out its children before we call getHitRect()public void run() { final Rect r = new Rect(); delegate.getHitRect(r); r.top -= 4; r.bottom += 4; parent.setTouchDelegate( new TouchDelegate( r , delegate));}});
亲测可用.
附上近期一篇火热的解析:
使用android.view.TouchDelegate扩大View的触摸点击区域
0 0
- [转载] #CheckBox expand its click area ##CheckBox扩大点击区域
- #CheckBox expand its click area ##CheckBox扩大点击区域
- 扩大checkbox的点击区域
- android checkbox 扩大点击区域
- checkbox 扩大点击范围
- android开发扩大CheckBox点击监听范围
- Knockout checkbox click 冲突
- Android 扩大点击区域
- UIButton 扩大点击区域
- 单击 label 触发 checkbox,checkbox 触发 click
- checkbox扩大点击范围以及一个监听器处理多个点击事件
- extjs4 checkbox绑定click事件
- click获取checkbox的值
- 扩大Button的点击区域
- 扩大UIButton的点击区域
- 扩大控件的点击区域
- Android TouchDelegate 扩大点击区域
- UIButton 扩大点击响应区域
- 常用正则表达式案例(不定期更新)
- java 常见几种发送http请求案例
- 资源宝库
- C++/C 千万别对结构体内部含有类使用memset赋值!!
- OPENCV 图像类型及相互转换
- [转载] #CheckBox expand its click area ##CheckBox扩大点击区域
- Qt使用九宫格原理缩放图片
- 简单管理Android手机程序的小程序
- Hibernate_初探之表单映射001
- 第十四章 数据库查询事例 上机1.2.3
- 【Unity插件】FingerGestures 插件使用
- N-gram
- 蓝桥杯 邮局
- Eclipse导入源码