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

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -