【发布时间】:2017-02-05 08:53:42
【问题描述】:
我用 viewpager 创建了一个选项卡式片段。有一个简单的列表视图来显示 farg1 中的数据。但是文本的颜色是白色的。怎么改成黑色。 listview 没有给 Textcolor 属性设置。 以下是应用于片段的片段主题代码:
<style name="FragTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:textColor">#000000</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
<!-- <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>-->
</style>
下面是布局xml的代码:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/tex1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Recently Used Mobile Number List "
android:textSize="15sp" />
<ListView
android:id="@+id/targetlist"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
目前将背景设置为黑色以使其可读。
【问题讨论】:
标签: java android listview fragment textcolor