Я пытаюсь создать макет, который всегда будет отображать 2 изображения, разделяя длину экрана одинаково на половину, не оставляя пробелов на экране (даже если изображения обрезаны в центре).Расположение Android с двумя изображениями, оставляющими пробелы внизу
До сих пор у меня есть следующий код, но это оставляет много пустого пробела в нижней части экрана. Причина, по которой я использую «RelativeLayout» в «LinearLayout», заключается в том, что я хочу, чтобы мое представление text1 попало в нижнюю часть моего изображения 1 (перекрывая изображение1).
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="230dp"
android:layout_marginBottom="3dp" >
<ImageView
android:id="@+id/img1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:contentDescription="@string/picture"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:padding="5dp"
android:textColor="#fff" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="230dp"
android:layout_marginBottom="3dp" >
<ImageView
android:id="@+id/img2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:contentDescription="@string/picture"
android:scaleType="centerCrop" />
</RelativeLayout>
Спасибо! Это работает. – KT100