我的 ListView 中有一个 ListView 显示 ImageButton。
我将 focusalble“false”和 focusableInTouchMode“false”设置为 ImageButton。
我设置了ListView.OnItemClickListner。当我运行我的项目时它会显示我的 ListView。
但是当我点击 Listview 时它不起作用。
然后我删除布局中的 ImageButton 并在单击 ListView It' 时再次运行我的项目
怎么了?
你不是唯一的受害者:)此行为通常被 Android 开发人员视为错误看看这个link https://code.google.com/p/android/issues/detail?id=3414他们的谈话。
要解决您的问题 - 只需包括android:descendantFocusability="blocksDescendants"
根布局中的属性。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)