如何管理textview
的焦点,例如在listview
中管理复选框焦点(如果我点击listitem
中的复选框,则仅点击复选框,如果我点击{{1没有单击复选框)。我试过的是:
listitem
可专注于真实。但textview
无法点击listitem
textview
是的。但focusableInTouchMode
无法点击答案 0 :(得分:1)
您可以在列表中使用selectors作为精彩视图。
或者如果你需要更困难的东西(TextView的行为必须做同样的工作,如CheckBox),那么你有两种解决方法
1)使用带有参数的CheckBox视图
android:button="@null"
android:background="@drawable/my_custom_selector_for_state"
2)点击并在适配器中的 getView(...)方法中设置后,“记住”项目对象中TextView的背景颜色