レイアウトの上部に2つのTextViewがあり、下部にImageViewがあるレイアウトを作成しようとしています。しかし、ImageViewのscaledingtypに問題があります。画像は常にプロポーショナルにサイズ変更する必要がありますが、常に中央の下部に配置する必要があります。これが私の問題の写真です:
私の問題を理解していただければ幸いです。
これが私のコードです:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent"
android:orientation="vertical" >
<TextView
android:id="@+id/textViewGameOver1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_gravity="top|center_horizontal"
android:gravity="center"
android:text="TextView1"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textViewGameOver2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textViewGameOver1"
android:layout_centerHorizontal="true"
android:layout_gravity="top|center_horizontal"
android:gravity="center"
android:text="TextView2"
android:textAppearance="?android:attr/textAppearanceLarge" />
<ImageView
android:id="@+id/imageViewGameOver"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_below="@+id/textViewGameOver2"
android:layout_centerHorizontal="true"
android:layout_gravity="bottom|center_horizontal"
android:scaleType="fitEnd"
android:src="@drawable/sheldon_win" />
</RelativeLayout>
この問題を解決するアイデアはありますか?
よろしくお願いします!