Highlight selected list item with selector in ActionBarSherlock

He guys want to highlight the selected list items as a list. I use ActionBarSherlock and set the selector to a list. I think this is the same as here . Selector i am using abs. I add a check box to each row, so I see which one is selected. But I need visual feedback, for example, in the Gmail application. Selected List Row are highlighted

So my question is this:

Is it possible to style the selected line using the selector or do I need to programmatically set the line style?

Note. I am creating my Android 2+ application and want to use the style from Android ICS, for example the ActionBarSherlock that it uses.

+4
source share
1 answer

I found a solution for my question.

For the ICS list selector (blue) that I set in my ListView at the beginning of the ActionBarSherlock list selector.

For high-light strings that point to the selected i element, the RelativeLayout extends, which is my root layout for ListRows and implements the Checkable interface. In this interface, I set a new background image in the setChecked (boolean) method.

Her good examples are:

Highlight the technique: 1 ICS selector: 2

+1
source

All Articles