1

i'm trying to set the color of my text in gold for my scoreboard. I tried the following but it doens't work. I dont get any errors but the color hasn't changed. Any ideas why ?

this is my color.xml thats sets the color gold for my scoreboard

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <style name="gold">
          <item name="android:textColor">#e6b121</item>
        </style>
    </resources>

I use it in my scoreboard.xml like this

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
        android:background="@drawable/backgroundsb" 
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

    <ListView
        android:id="@+id/listViewscores"
        style="@style/gold" 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" >
    </ListView>

    <Button
       android:id="@+id/opnieuw"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignParentBottom="true"
       android:layout_centerHorizontal="true"
       android:text="Opnieuw spelen" />

    </RelativeLayout>
4

1 回答 1

0
<?xml version="1.0" encoding="utf-8"?><resources><color name="white">#FFFFFF</color><color name="black">#000000</color><color name="green">#008000</color><color name="blue">#0000FF</color>     <color name="red">#FF0000</color> <color name="gray">#858585</color></resources

将带有 color.xml 的 xml 文件保存在 values 文件夹中,并将其用于文本视图作为 "android:textColor="@color/blue"

于 2013-05-01T12:24:24.033 回答