How to change color of listview item?

MaxNunezMaxNunez CRMember ✭✭
edited September 2013 in Xamarin.Android

I downloaded the example that xamarin offers about list views but I need to change the text color .
I tried with text color on source of axml but It doesn't works for me.
This is my axml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal">       
        <EditText
            android:id="@+id/eTxtBuscar"
            android:layout_height="wrap_content"
            android:layout_width="fill_parent"
            android:hint="Buscar"
            android:textColorHint="#ff181111" />
    </LinearLayout>
    <ListView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#ff120e0e"
        android:id="@+id/LstBuscador" />
</LinearLayout>

In the ListView It shows the data but I don't know how to change the color .... Besides, if the change is not here.
How to change the color from xamarin code and not from axml.

I saw about UI.Color but I don't knows if it is necessary in my case.

Posts

  • CheesebaronCheesebaron DKInsider, University mod

    You will need to create a custom ListItem, which you pass to the Adapter you are using. Or if you are using a custom Adapter you will use that layout when inflating it. There are loads of samples on how to do this out there...

Sign In or Register to comment.