Android list view new line (\n) different color?

Jattdressor

New Member
I have a list view where I have 2 lines for every item. That looks like so:\[code\]Title of item1Subtitle of item1\[/code\]I was wondering if there is a way to change the color and size of the 2nd line by code?
They both share 1 \[code\]TextView\[/code\] 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.\[code\] <?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">\[/code\]Here is my custom list view xml:\[code\]<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>\[/code\]Here is how I'm assigning the xml to the list view:\[code\] ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(this,R.layout.row, R.id.label, arrayList); lv.setAdapter(arrayAdapter); \[/code\]
 
Back
Top