次のような RelativeLayout があります。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/favoriteLinearLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/background1"
>
....
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/background2"
android:layout_below="@+id/linearLayout1"
>
....
</LinearLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/background3"
android:layout_below="@+id/linearLayout2"
>
....
</LinearLayout>
</RelativeLayout>
3 つの LinearLayouts のそれぞれに異なる背景画像が必要です。この画像は、画像の縦横比を維持せずに LinearLayout を満たすようにスケーリングする必要があります。また、各 LinearLayout を画像のサイズに合わせてスケーリングしたくありません (画像が LinearLayout よりも高い場合は、画像の高さを減らしたい)。
今後は、次のようになります。
誰でもこれを行う方法を知っていますか?
ありがとう !!