1
我想爲我的記分牌設置我的黃金文本的顏色。我嘗試了以下,但它不工作。我沒有得到任何錯誤,但顏色並沒有改變。任何想法爲什麼?不要想得到xml的顏色android
這是我color.xml這就是設置顏色爲金記分牌我
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="gold">
<item name="android:textColor">#e6b121</item>
</style>
</resources>
我用它在我的scoreboard.xml這樣
<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>
這不會改變listitem的顏色,你需要改變列表行的顏色。發佈你的活動代碼,我將展示如何做到這一點 – Pragnani 2013-04-29 15:33:24
settextcolor是不可能的我想? – 2013-04-29 16:03:30
填充列表視圖時,您將使用其行資源進行適配,您需要提供自定義佈局 – Pragnani 2013-04-29 16:05:01