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