I have a issue with my listview, I basicly want the text in the fields (in the listview) to become black instead of white as default. I’ve followed a simple guide how manage this but it is not working for me. This is the guide: http://www.hascode.com/2011/12/writing-styles-and-themes-on-android/ .
This is my style.xml file were I try to enter a dark color to the text:
<style name="CustomTextView" parent="@android:style/Widget.TextView">
<item name="android:typeface">monospace</item>
<item name="android:textColor">#000000</item>
</style>
This is my bookmarks.xml were I try to load the style in the listview with following 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="fill_parent"
android:orientation="vertical">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/CustomTextView">
</ListView>
</LinearLayout>
I’ve also tried to change the parent name in the style.xml to TextAppearance.Medium instead, but nothing works. Am I missing smomething, why can´t I just change the damn color? Please help! Thanx!
ListView is a kind of container… Inside list view you add the views.. in your case you are adding TextViews… so you should set the style of that TextView which you are adding to this ListView…