<!-- Defines the relationship between the ViewGroup and its descendants
when looking for a View to take focus. -->
<attr name="descendantFocusability">
<!-- The ViewGroup will get focus before any of its descendants. -->
<enum name="beforeDescendants" value="0" />
<!-- The ViewGroup will get focus only if none of its descendants want it. -->
<enum name="afterDescendants" value="1" />
<!-- The ViewGroup will block its descendants receiving focus. -->
<enum name="blocksDescendants" value="2" />
</attr>
when looking for a View to take focus. -->
<attr name="descendantFocusability">
<!-- The ViewGroup will get focus before any of its descendants. -->
<enum name="beforeDescendants" value="0" />
<!-- The ViewGroup will get focus only if none of its descendants want it. -->
<enum name="afterDescendants" value="1" />
<!-- The ViewGroup will block its descendants receiving focus. -->
<enum name="blocksDescendants" value="2" />
</attr>
本文介绍了Android中ViewGroup的descendantFocusability属性,该属性定义了ViewGroup与其子视图之间的焦点交互方式。主要包括beforeDescendants(ViewGroup优先于子视图获取焦点)、afterDescendants(仅当子视图不需要焦点时ViewGroup才获取焦点)和blocksDescendants(阻止子视图接收焦点)三种模式。
801

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



