我希望只有一个列表视图,而不是主题的默认颜色,使用不同的文本颜色。我可以覆盖文本大小、样式和行背景颜色,但文本颜色仍然是主题的默认值。有人能告诉我我做错了什么吗?这是我的styles.xml:
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
<style name="rowstyle" parent="@style/rowbackground">
<item name="android:textColor">#FFFFFF</item>
<item name="android:textSize">25sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="rowbackground" >
<item name="android:background">@drawable/row_background</item>
<item name="android:paddingLeft">15dp</item>
</style>
</resources>
以下是activity_main.xml的代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.houstone.MainActivity" >
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="@+id/countries"
android:id="@+id/cities"
style="@style/rowstyle"/>
</RelativeLayout>