xml - How Do I Make my Screen Scrollable in Android Eclipse -
this xml code have before attempt adjust scrollable:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <!-- widgets --> </relativelayout> how edit make scrollable? dragging on scrollview widget list messes up.
make sure leave version/encoding line @ top of file.
change relativelayout scrollview , nest relativelayout section (containing of widgets) inside new scrollview.
make sure give relativelayout dimensions, should same scrollview width , height dimensions.
the reason nesting of relativelayout contains widgets scrollview element can have 1 child element (in case, relativelayout, has own children).
therefore code:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <!-- widgets --> </relativelayout> turns code:
<?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" > <!-- widgets --> </relativelayout> </scrollview>
Comments
Post a Comment