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有被点击的效果,但是不执行点击事件“
本文介绍了Android中View的duplicateParentState属性,当设置为true时,View会从其直接父级继承绘制状态(如聚焦、按下等),但不会影响事件处理。
1032

被折叠的 条评论
为什么被折叠?



