Android Scrollview Example

Reading Time: 2 minutes

If you want to go beyond helloworld application, you need to learn to use Android Scrollview layout. In this tutorial we have Android scrollview example. Let’s start with new blank activity project. In the new blank activity project default layout is RelativeLayout. We need to change it to LinearLayout, but let’s keep RelativeLayout for a while to see the difference. Then add one image view and text view widget. Bellow, put some repeated combination of text view and text fields.  Here how it should look like during designing:


However, when you test it on real device, it looks something like this:


This is consequence of RelativeLayout. So let’s change it to LinearLayout. Now, we have following consequence:


Now, its a moment to use Scrollview layout. So, add
tag in your main XML file. Between these two tags there should be all your widgets. Below scrollview layout put one linear layout.






Now it is almost done. What we need is to put as menu linear layouts as many rows we want to have:


Download this project.

External links:

Android Scrollview Example on YouTube
Android Scrollview Example on javatechig
Android Scrollview Example on github
Android Scrollview Example on androidhub4you

Tagged with: ,

Leave a Reply

Your email address will not be published. Required fields are marked *