【发布时间】:2011-01-25 20:30:15
【问题描述】:
我为 ListView 应用了背景颜色
<style name="CKButtons">
<item name="android:windowBackground">@color/window_background</item>
</style>
但每次滚动列表时,背景颜色都会变回系统默认值(黑色)。当滚动停止时,颜色会变回@color/window_background。
样式应用在AndroidManifest.xml:
<activity android:name=".event.EventList"
android:theme="@style/CKButtons"></activity>
我的 ListView 看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/android:list"/>
<TextView
android:id="@+id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="@string/eventlist_no_items"/>
</LinearLayout>
我怎样才能防止这种情况发生?
【问题讨论】:
标签: xml android listview styles