문제

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