Я создал приложение, которое состоит из RelativeLayout
.После добавления всей информации RelativeLayout
слишком мал, чтобы вместить всю информацию. Мне нужно иметь возможность прокручивать вверх и вниз, используя макет ScrollView
.Я устал заменять слово RelativeLayout
на ScrollView
, а также добавлять ScrollView
в RelativeLayout
, но мое приложение вылетает.Поэтому не уверен, куда поместить ScrollView
.
main_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
tools:context=".MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true">
<mudasir.com.gifsimages.GIF.GifImageView
android:id="@+id/GifImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true" />
<mudasir.com.gifsimages.GIF.GifImageView
android:id="@+id/GifImageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
<mudasir.com.gifsimages.GIF.GifImageView
android:id="@+id/GifImageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/btnNextScreen"
android:orientation="vertical">
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/cbk1"
android:text="CickABle CheckBox" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CickABle CheckBox" />
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CickABle CheckBox" />
</LinearLayout>
<Button
android:id="@+id/btnNextScreen"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="10dp"
android:text="NEXT SCREEN" />
</ScrollView>
</RelativeLayout>