相対レイアウトで画像のサイズを大きくしようとしています。現在、その幅と高さは に設定されていwrap_content
ます。それらを設定するfill_parent
と、画像は大きくなりますが、ディスプレイの下にあるボタンを押してしまいます。関連する XML を以下に示します。私は何を間違っていますか?
編集:すべての回答に感謝しますが、これまでのところ、画像の高さをfill_parent
またはに設定するmatch_parent
と、ボタンが相対レイアウトの内外にあるかどうかに関係なく、常にディスプレイの下部まで拡張されます。相対レイアウトがその下にあるものを無視するのはなぜですか?
<LinearLayout>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativelayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/myImageView"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/apple"
android:alpha=".5"
android:paddingBottom="0dp"
android:adjustViewBounds="true" />
<TextView
android:id="@+id/myImageViewText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="Sample"
android:textColor="#000000"
android:singleLine="true"
android:layout_alignLeft="@+id/myImageView"
android:layout_alignStart="@+id/myImageView"
android:layout_alignParentTop="true" />
</RelativeLayout>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/enterPluButton"
android:background="#FFBD5C"
android:textColor="#000000"
android:text="Submit" />
</LinearLayout>