Я использовал следующий код для отображения серии кнопок изображения по вертикали.Я могу успешно прокручивать созданные мной изображения, но в середине экрана есть пробел, который я не могу исправить.Я полагаю, что ошибка происходит из-за LinearLayout, который я использовал, но переключая его с помощью относительной или содержащей компоновки, которая ничего не изменила.
Мой код:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/homepbckrnd">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageButton
android:id="@+id/imageButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
app:srcCompat="@mipmap/facebook" />
<ImageButton
android:id="@+id/imageButton2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="229dp"
app:srcCompat="@drawable/ddrr" />
<ImageButton
android:id="@+id/imageButton3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="0dp"
app:srcCompat="@drawable/ic_poll_black_24dp" />
<ImageButton
android:id="@+id/imageButton4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginEnd="0dp"
app:srcCompat="@mipmap/google" />
<ImageButton
android:id="@+id/imageButton5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ddrr" />
<ImageButton
android:id="@+id/imageButton6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/facebook" />
<ImageButton
android:id="@+id/imageButton7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:srcCompat="@mipmap/facebook" />
</LinearLayout>
</ScrollView>
</RelativeLayout>