Reputation: 13199
I have a LinearLayout
in Android
that has this structure:
<LinearLayout>
<LinearLayout>
<EditText></EditText>
<TextView></TextView>
</LinearLayout>
//Here more LinearLayout similar to the LinearLayout that I put above
</LinearLayout>
But I have so much EditText
and LinearLayout
in my layout that I can't see the full layout in the screen of my mobile phone. It won't be a problem if I could move the screen to see the full layout, but I couldn't. I just can see the elements that enter in the screen, the rest aren't accesible.
I saw a lot of questions but any of them let me fix my error.
What can I do?
Thanks in advance!
Upvotes: 1
Views: 88
Reputation: 1581
Choose a ScrollView as container for your layout
Like this:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout>
<LinearLayout>
<EditText></EditText>
<TextView></TextView>
</LinearLayout>
//Here more LinearLayout similar to the LinearLayout that I put above
</LinearLayout>
This is the referece about ScrollView
Upvotes: 2
Reputation: 2727
Use ScrollView
as root
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scroll"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout>
<LinearLayout>
<EditText></EditText>
<TextView></TextView>
</LinearLayout>
//Here more LinearLayout similar to the LinearLayout that I put above
</LinearLayout>
</ScrollView>
Upvotes: 1
Reputation: 1099
Try packaging your most outer LinearLayout
with a ScrollView
. This will allow your users to scroll down and see all the content.
Good luck!
Upvotes: 0