Skip to content Skip to sidebar Skip to footer

How Do I Make My Screen Scrollable In Android Eclipse

This is the XML code I have before I attempt to adjust it to be scrollable:

The reason for this nesting of the RelativeLayout that contains all the widgets is that a ScrollView element can only have one child element (in this case, the RelativeLayout, which then has its own children).

Therefore this code:

<?xml version="1.0" encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent" ><!-- all your widgets --></RelativeLayout>

Turns into this code:

<?xml version="1.0" encoding="utf-8"?><ScrollViewxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent" ><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="match_parent" ><!-- all your widgets --></RelativeLayout></ScrollView>

Post a Comment for "How Do I Make My Screen Scrollable In Android Eclipse"