0
我想讓可滾動佈局,因爲我的TextView有長文本。我搜索並找到了一些解決方案,例如在我的RelativeLayout中創建一個ScrollView,並在那裏創建另一個RelativeLayout。並像這樣改變了我的xml代碼。但沒有發生。如何使RelativeLayout可滾動?
這是我的XML代碼:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.arsh.fina.IntroActivity">
<include layout="@layout/content"/>
<ScrollView
android:layout_marginTop="55dp"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="55dp">
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="13dp"
android:adjustViewBounds="true"
app:srcCompat="@drawable/surv1"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_below="@+id/imageView3"
android:layout_marginTop="20dp"
android:textColor="#FFFFFF"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="A VERY
VERY
VERy
VERY TEXT"/>
</RelativeLayout>
</ScrollView>
<android.support.v4.widget.DrawerLayout
android:id="@+id/a1"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_marginTop="55dp">
<android.support.design.widget.NavigationView
android:id="@+id/a2"
android:layout_gravity="right"
android:layout_height="match_parent"
android:layout_width="180dp"
app:headerLayout="@layout/header"
app:menu="@menu/drawer"/>
</android.support.v4.widget.DrawerLayout>
</RelativeLayout>
我在哪裏去了?
感謝您的時間。我做到了,但沒有發生任何事情...... – Arshiiia13