Siva K
Siva K

Reputation: 4968

how to set text color in list view in android app

in my app i have created a list view and added some text in the list. In my coding part the text are been added as an array adapter to have a check box. In the layout i have given a white color for the list view because of this the text appear to be very dull. How to set the text color to be as black.

Upvotes: 0

Views: 2938

Answers (2)

Jim
Jim

Reputation: 829

set the text color in your xml

< TextView
android:id="@+id/list_content"
android:textColor="#000000"
android:gravity="center"
android:text="sample"
android:layout_margin="4dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>

Upvotes: 1

nicholas.hauschild
nicholas.hauschild

Reputation: 42834

If the text is added as a part of a TextView, you should be able to call setTextColor(int) on it.

Upvotes: 0

Related Questions