3 つの ImageView を表示するために使用している LinearLayout (Horizontal) があります。最初に ImageViews を追加すると、画像が大きすぎて 3 つに収まらないため、最後の 1 つが縮小されます。私のデザイナー画面は次のようになります。
3 番目のイメージが縮小されていることに注意してください。
この問題を修正するために、各 ImageView に次の属性を設定しました。
width: 0dp
weight: 1
これらの属性を設定した後の画像の外観は次のとおりです。
私が直面している問題は、画像が縮小されていても、次の画像の青い四角形で示されているように、上部と下部にまだスペースがあることです。
私の質問は、なぜこの余分なパディングがあり、どうすればそれを取り除くことができるのでしょうか?
ありがとうございました
更新 - レイアウト ファイルの追加
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="@color/app_background_color"
android:contentDescription="@string/game_image_button"
android:gravity="center"
tools:context=".EasyActivity" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/ImageView02"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="@string/game_image_button"
android:src="@drawable/ruler200x200" />
<ImageView
android:id="@+id/ImageView01"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="@string/game_image_button"
android:src="@drawable/ruler200x200" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:contentDescription="@string/game_image_button"
android:src="@drawable/ruler200x200" />
</LinearLayout>
</RelativeLayout>