0

次の問題があります: テーマ付きの背景画像を持つ通常の ListView を使用しているため、パフォーマンスが大幅に低下します。ウィンドウ (themes.xml を参照) の背景画像を削除すると、すべてが滑らかになります。背景画像を使用すると、速度が著しく低下します。

私はすでに試しました:

  • android:cacheColorHint="#00000000"
  • listview.setScrollingCacheEnabled(false);

しかし、何も機能しませんでした。ListView はただの白なので、なぜこれが遅いのかわかりません - 問題はないはずです...

テーマ.xml:

 <item name="android:windowBackground">@drawable/window_bg</item>

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>
4

1 に答える 1

0

背景が白の場合は、drawable を使用する代わりに背景色を白に設定できるかどうかを確認してください。物事は即座にスピードアップします!

于 2012-10-06T14:57:03.827 に答える