ImageView の src として次の画像があります。これを背景画像として使用します。これにより、アプリケーションのメモリが最大 5MB から最大 20M に増加します。
これは、この画像を使用するコードです: (android:id="@+id/listViewBackground" は、私が話しているイメージビューです)
<RelativeLayout
android:id="@+id/ContentLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ButtonsMenu"
android:background="@android:color/transparent" >
<ImageView
android:id="@+id/listViewBackground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:scaleType="center"
android:src="@drawable/background" />
<LinearLayout
android:id="@+id/header"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@android:color/transparent" >
<TextView
android:id="@+id/leftHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_green"
android:gravity="center"
android:text="@string/Title_BatteryLevel"
android:textColor="@android:color/white" />
<TextView
android:id="@+id/rightHeader"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_blue"
android:gravity="center"
android:text="@string/Title_Duration"
android:textColor="@android:color/white" />
</LinearLayout>
<LinearLayout
android:id="@+id/AdLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@android:color/transparent" >
</LinearLayout>
<ListView
android:id="@+id/listView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@id/AdLayout"
android:layout_below="@id/header"
android:background="@android:color/transparent"
android:cacheColorHint="#00000000"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:listSelector="@android:color/transparent"
android:paddingBottom="5dp" >
</ListView>
</RelativeLayout>
この画像は、さまざまな画面サイズに対応する必要があるため、高解像度です。ラインも見えるようにしたいです。
アプリが使用するメモリを減らすにはどうすればよいですか?