I have a list of items in a listView. I would like to highlight the first item of this listview so that the user knows top item is active. How can I go about doing this?
Something like the image
Asked
Active
Viewed 1,020 times
0

isudansh
- 370
- 3
- 16
-
Set android:listSelector and android:drawSelectorOnTop in you listview. – Sripathi May 08 '14 at 07:52
-
listSelector needs drawable and drawSelectorOnTop is a flag. – Sripathi May 08 '14 at 07:53
-
create custom a drawble and use it as background of listview then listview.setselection(int pos). – srinivas May 08 '14 at 07:59
1 Answers
2
Try Some like tha: create custom listview adapter like that and adapter, Custom adapter for a list of items that have multiple child items? then set bg like that:
if (position == 0) {
// define layout here list 1st item
view.setBackground(R.drawable.bg);
} else {
// others
view.setBackground(R.drawable.bg);
}

Community
- 1
- 1

Engr Waseem Arain
- 1,163
- 1
- 17
- 36