У меня есть пустое действие, которое содержит много текстового вида, поэтому я хочу использовать scrollview, но всякий раз, когда я его использую, текстовые представления смещаются от их предварительно назначенного положения к вершине. Before adding ScrollView и After adding ScrollView вот код XMLScrollview Realigns textView
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OFF"
android:id="@+id/button"
android:onClick="torchToggle"
android:layout_below="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_marginTop="71dp"
android:background="#cdc6c6" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Torch"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:textColor="#e8d9d9" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/textView2"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textColor="#dacece"
android:text="#Error In display" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView3"
android:layout_below="@+id/textView2"
android:layout_centerHorizontal="true"
android:layout_marginTop="83dp"
android:textColor="#cdc0c0"
android:text="#Error in display" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView4"
android:textColor="#f3ef7a"
android:layout_below="@+id/textView3"
android:layout_centerHorizontal="true"
android:text="#Error in display" />
<ProgressBar
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/progressBar"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
<Button
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="next"
android:id="@+id/button2"
android:layout_alignTop="@+id/button"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:nestedScrollingEnabled="false"
android:onClick="nextActivity" />
</RelativeLayout>
</ScrollView>