Scrollable layout in Android
Asked Answered
D

2

31

I have a registration form in a LinearLayout as shown below:

alt text

When emulator screen is in it's default position it is working fine. But when I rotate the emulator screen it only displays the elements which are fit to screen and remaining are wrap up. As shown in below screen: alt text

Now I want to make this layout scrollable but not getting the idea. Any help will be highly appreciated.

Devaluation answered 17/11, 2010 at 7:54 Comment(0)
K
89

Try putting your LinearLayout inside an ScrollView like this:

<?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:id="@+id/menu_ll"
        android:layout_width="fill_parent" android:layout_height="fill_parent"></LinearLayout>

</ScrollView>
Kristeenkristel answered 17/11, 2010 at 8:21 Comment(1)
Thanks Fredrik, Actually I did also tried it before posting this question but because of some sort of problem's with Android Layout XML plugin it was not working.Devaluation
Z
0

I simply added this code in my activity of AndroidManifest.xml

android:windowSoftInputMode="stateVisible|adjustResize"
Zimmer answered 26/10, 2018 at 8:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.