开发者

Android ListView Custom Row Selection

开发者 https://www.devze.com 2023-02-09 00:22 出处:网络
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开发者

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

精彩评论

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