w.donahue
w.donahue

Reputation: 10886

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 built 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?

Upvotes: 0

Views: 729

Answers (1)

jlugo
jlugo

Reputation: 324

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.

Upvotes: 1

Related Questions