Question

Selected listview item with (arrow?)

As seen in the above picture you see this arrow at the right side that is pointing from a other layout to a selected listitem in a listview. I don't know how this is called, so I don't know what to google.

How would one achieve this?

Was it helpful?

Solution

Use a selector to achieve this. such that the listview's listitemselector will be set to the custom selector that you make. Also in the selector you will have an image as that green colored selector.

for example:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_focused="true" android:drawable="@drawable/bg_green_with_arrow"></item>
<item android:state_selected="true" android:drawable="@drawable/bg_green_with_arrow"></item>
<item android:state_active="true" android:drawable="@drawable/bg_green_with_arrow"></item>
<item android:state_pressed="true" android:drawable="@drawable/bg_green_with_arrow"></item>
<item android:drawable="@drawable/bg_white_plain"></item>
</selector>

OTHER TIPS

Check this out if its of your Help. Its called the Navigation Drawer

http://manishkpr.webheavens.com/android-navigation-drawer-example-using-fragments/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top