make layout scrollable in android

make Layout Scrollable Android, you first need to understand that ScrollView must contain only one child, so if you have a lot of views, you need to wrap them up in a view group i.e. Linear Layout

An example to make layout scrollable android

For Example if you have Something like this….

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Insert Appropriate views here>
</LinearLayout>

You must therefore make Scrollview the root as the code Snippet below

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Insert Appropriate views here-->
</LinearLayout>
</ScrollView>

Any questions, Leave a Comment below