开发者

Android ListView Custom Row Selection

I have a ListView with a custom row type that contains the following:

|Text|Spinner|

I have the row currently clickable on the spinner but not on the text. My problem is that if I used the buil开发者_StackOverflow中文版t in keyboard D-Pad to browse the ListView then the entire row is highlighted when I only want it to highlight the Spinner. How do you handle the D-PAD in such a fashion?


In your XML file, locate the Spinner and add:

android:focusable="true"

Then disable focusing on the layout that contains them. For instance, if you have those side-by-side inside of a LinearLayout, then find the LinearLayout and add:

android:focusable="false"

It's also a good idea to ensure the text is focusable so that users with vision impairment can use a screen reader to hear the text read aloud.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜