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?

有帮助吗?

解决方案

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>

其他提示

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

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top