I have a list view where I have 2 lines for every item. That looks like so:
Title of item1
Subtitle of item1
I was wondering if there is a way to change the color and size of the 2nd line by code?
They both share 1 TextView
so I can't just edit that. I could use 2 text views but I'm not sure how to set that up.
I am using a custom xml for the list view though.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
Here is my custom list view xml:
<RelativeLayout android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="7dip">
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#474747"
/>
</RelativeLayout>
</LinearLayout>
Here is how I'm assigning the xml to the list view:
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,R.layout.row, R.id.label, arrayList);
lv.setAdapter(arrayAdapter);