[英]How can a widget make its ancestor focused?
my layout: 我的布局:
<LinearLayout>
<FrameLayout>
<CheckBox />
</FrameLayout>
</LinearLayout>
I need the linearlayout
to get focused when the checkbox is clicked, so that the linearlayout
shows focused-background. 单击复选框时,我需要
linearlayout
使其焦点linearlayout
,以便linearlayout
显示focused-background。
Does anyone have any ideas? 有人有什么想法吗?
请尝试以下操作:
checkBox.getParent().getParent().requestFocus();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.