Android listView使用背景图像时速度非常慢

Android listView使用背景图像时速度非常慢,android,performance,listview,background-image,Android,Performance,Listview,Background Image,我有以下问题:我使用的是带有主题背景图像的常规ListView,这让我在性能上非常头疼。当我移除窗口(请参阅themes.xml)背景图像时,一切都是平滑的。对于背景图像,速度明显较慢 我已经试过了: android:cacheColorHint=“#00000000” listview.SetScrolingCacheEnabled(false) 但什么都没用。我不明白为什么这么慢,因为ListView是纯白色的-不应该是个问题 theme.xml: <item name="and

我有以下问题:我使用的是带有主题背景图像的常规ListView,这让我在性能上非常头疼。当我移除窗口(请参阅themes.xml)背景图像时,一切都是平滑的。对于背景图像,速度明显较慢

我已经试过了:

  • android:cacheColorHint=“#00000000”
  • listview.SetScrolingCacheEnabled(false)
但什么都没用。我不明白为什么这么慢,因为ListView是纯白色的-不应该是个问题

theme.xml:

 <item name="android:windowBackground">@drawable/window_bg</item>
@drawable/window\u bg
list.xml

<RelativeLayout 
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:orientation="vertical"
  android:padding="10dp">
  <ListView
        android:id="@+id/my_list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@color/white"/>
</RelativeLayout>


如果只是白色背景,请查看是否可以将背景颜色设置为白色,而不是使用可绘制的颜色。事情会立刻加速的

您是为每个列表项(在自定义适配器中)应用背景还是将背景作为一个整体应用于listview?目前,我将背景颜色设置为每个列表项。我在列表项中删除了它,因为它是不必要的,但仍然存在相同的性能问题。我知道,但我需要所有活动窗口的图像背景,以及列表视图。实际上,这不应该影响listview的性能,因为完整的listview有一个白色的背景。您是否使用listview的自定义适配器?