Android View 的TouchMode
来源:互联网 发布:软件测试管理软件 编辑:程序博客网 时间:2024/05/16 05:52
1.由来:touchmode是区分触摸状态和非触摸状态而设置的。
2.touchMode就是当你点击屏幕(当然是触摸屏)的时候就会被激活,而你点击物理按键的时候则会退出此模式。
3.setFocusableInTocuMode与setFocusable的区别:
先说说focus,这就要说道focusable与touchable这两个概念,当你点击屏幕的时候,如果你点的是一个button,那么这个就是touchable,但是unfocusable。而当你点击edittext的时候则是touchable与focusable的状态。说到这里大家都懂的是什么意思了。处于focusable的时候,一般都会有highlight.
在View中源码有一段解释,很好的说明了问题:
* When a user is navigating a user interface via directional keys such as a D-pad, it is
* necessary to give focus to actionable items such as buttons so the user can see
* what will take input. If the device has touch capabilities, however, and the user
* begins interacting with the interface by touching it, it is no longer necessary to
* always highlight, or give focus to, a particular view. This motivates a mode
* for interaction named 'touch mode'.
* </p>
* <p>
* For a touch capable device, once the user touches the screen, the device
* will enter touch mode. From this point onward, only views for which
* {@link #isFocusableInTouchMode} is true will be focusable, such as text editing widgets.
* Other views that are touchable, like buttons, will not take focus when touched; they will
* only fire the on click listeners.
* Any time a user hits a directional key, such as a D-pad direction, the view device will
* exit touch mode, and find a view to take focus, so that the user may resume interacting
* with the user interface without touching the screen again.
上面的英文说的很清楚,就不做过多解释了。
- Android View 的TouchMode
- android TouchMode下的focus问题
- android TouchMode下的focus问题
- 安卓开发-TouchMode
- android view的setVisibility
- Android View的ScrollBar
- Android的视图(View)
- Android的View详解
- Android view 的cache
- android的demo view
- Android View的拖动
- android View的生命周期
- android view的应用
- android的自定义View
- Android View的ScrollBar
- Android View 的生命周期
- Android View的ScrollBar
- android view 的学习
- RabbitMQ消息队列(三):任务分发机制
- 第5章 绘图基础
- Android不可用方法
- RabbitMQ消息队列(四):分发到多Consumer(Publish/Subscribe)
- 为什么选择Spring MVC及demo
- Android View 的TouchMode
- Android中两个Activity之间数据传递及返回
- table的样式设置
- Tomcat集群Cluster实现原理剖析
- 黑马程序员——C语言日志——文件的操作
- 将EXCEL表数据导入到数据库中
- redis 常用命令
- 解决“listView点击一个Item,另外几个Item也跟着改变”的问题
- 每个Android开发者必须知道的内存管理知识