Search code examples
androidandroid-layoutandroid-scrollview

Trying to make my entire layout scrollable


I have designed my layout and on smaller phone screens not everything is visible, so I'd like to make it scrollable, could somebody help me with how to go about this? Below is the basic structure of my layout.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/allowanceroot"
    android:background="@drawable/background"
    >
    --TextView--
    --EditText--
    --TextView--
    --EditText--
    --TextView--
    --EditText--
</LinearLayout>

Do I just contain my TextViews and EditTexts in a LinearLayout, and then contain that in a ScrollView? Also is there anything I need to do programmatically?


Solution

  • Try wrapping it in a scrollview

    https://stackoverflow.com/a/4202608/661079

    There is nothing else you need to do