ListView Selected Native

I would like to remove the selected native listview and put a custom Select item.

Sugestion? I try e.View.SetBackgroundColor(Android.Graphics.Color.Orange); but my row no change background.

http://img189.imageshack.us/img189/4043/listview.png

Posts

  • CheesebaronCheesebaron DKInsider, University mod

    You need to create a Selector for this.

    Something in the lines of:

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
      <item android:state_enabled="false" android:state_focused="true"
            android:drawable="@drawable/item_disabled" />
      <item android:state_pressed="true"
            android:drawable="@drawable/item_pressed" />
      <item android:state_focused="true"
            android:drawable="@drawable/item_focused" />
    </selector>
    

    Then set it with:

    android:listSelector="@drawable/listselector"
    
  • kabelimbhkabelimbh BRMember

    ListView have attribute listSelector in version android 2.3.3?

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    Yes, since API level 1.

Sign In or Register to comment.