Anderson Dutra
Anderson Dutra

Reputation: 101

Android: How to change Relative Layout to Scroll Layout

Hello i have an Relative Layout in Android, with EditTexts, TextViews, one Spinner and RadioButtons. It's a lot of things for only one screen, so i need to change for a ScrolView. When i try add the line in the first line and on the last Row, I have problems.

How can i add a scroll on my screen without lose all the layout I built so far?

Upvotes: 2

Views: 736

Answers (2)

gwvatieri
gwvatieri

Reputation: 5183

As @CommonsWare has said, you can just wrap your current layout with a ScrollView.

Just keep in mind that a ScrollView must have only one child.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1006664

so i need to change for a ScrolView

You do not need to change "for a ScrolView". You need to wrap your RelativeLayout in a ScrollView.

How can i add a scroll on my screen without lose all the layout I built so far?

Put a ScrollView around your RelativeLayout:

<ScrollView>   
    <RelativeLayout> 
               <!-- existing stuff here -->
    </RelativeLayout> 
</ScrollView>  

Upvotes: 1

Related Questions