Ich habe eine MainActivity mit Navigationsschublade. Ich erstelle ein Fragment für jeden Artikel ist in meiner Nav-Schublade. Ich habe eine toolbar.xml, die in meiner content.xml enthalten ist, und ich möchte meine content.xml als Standardlayout für meine Fragmente festlegen. aber ich möchte es scrollbar machen, weil einige meiner Fragmente viele Text & Bilder haben! Ich verwende Scrollview in einem Relativayout in meinem Fragmentlayout, aber es funktioniert nicht.make ein fragment_layout scrollbar
das ist mein content.xml, dass ich es als Standard-Layout für Fragmente festlegen möchten:
<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:id="@+id/layout_for_fragment"
android:layout_height="match_parent"
android:background="#132740">
<include layout="@layout/toolbar" />
</RelativeLayout>
und das ist mein IntroFragment.xml:
<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="@color/colorPrimary"
tools:context="com.example.arsh.enc.IntroFragment">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="@+id/introfragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:lineSpacingExtra="10sp"
android:text="VERY VERY
VERY VERY
VERY VERY
VERY VERY
VERY VERY LONG TEXT"
android:textColor="#FFFFFF" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
wie ich schon sagte, ich Verwenden Sie ScrollView, aber es gibt kein Ergebnis. Kann mir jemand sagen, wo ich falsch gelaufen bin? und was soll ich tun, um mein Problem zu lösen?
du hast recht es schon scrollbaren ist, aber es gibt keine Notwendigkeit zu verwenden Listview – godot