android:duplicateParentState="true"
16lz
2021-12-04
android:duplicateParentState
When this attribute is set to true, the view gets its drawable state (focused, pressed, etc.) from its direct parent rather than from itself.
Must be a boolean value, either "true
" or "false
".
This may also be a reference to a resource (in the form "@[package:]type:name
") or theme attribute (in the form "?[package:][type:]name
") containing a value of this type.
This corresponds to the global attribute resource symbol duplicateParentState
.
View的一个比较实用的属性
如果设置此属性,将直接从父容器中获取绘图状态(光标,按下等)。 注意仅仅是获取绘图状态,而没有获取事件,也就是你点一下LinearLayout时Button有被点击的效果,但是不执行点击事件“
更多相关文章
- 【阿里云镜像】切换阿里巴巴开源镜像站镜像——Debian镜像
- Android获取SD卡路径/内存的几种方法
- Android中可以做的两件坏事---破解锁屏密码和获取Wifi密码
- 尝试用Android获取IMEI,折腾的一天,结果只有一句话,是不是用混合编
- Android(安卓)获取View的位置参数:x,y和相对父容器的偏移量以及中
- android:windowSoftInputMode属性使用
- Android(安卓)系统图标
- 获取Android自带资源的方式
- Android下如何获取Mac地址?