E. Quku E. Quku - 5 months ago 8
Android Question

How to enter more data than a screen to an Activity

I am a beginner at Android Studio and, for example, I want to make 30 buttons on a vertical

Linear Layout
or I have a very long text. How can I display it all in one screen? I mean how can I make it scrollable ?

Answer

I think is this

<ScrollView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/scrollView2" >

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New Button"
            android:id="@+id/button5" />

        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New Button"
            android:id="@+id/button6" />
    </LinearLayout>
</ScrollView>

add the buttons you want the view will scroll