Loading...

Android ScrollView Example

In this tutorial, you will learn to use Android ScrollView component in application. ScrollView is a different kind of layout than LinearLayout, RelativeLayout, etc. which is designed to view larger than its actual size. If the views inside ScrollView are more than the views that can be hold/contained within ScrollView then a scrollbar is automatically added.

Related:
Android Custom Vertical ScrollView Example
Android Custom Horizontal ScrollView Example
Android WebView Tutorial with Example

Android Example: How to use Android ScrollView Component


Create a new Android Project
Let’s start by creating a new android project with following information

Application Name: Android ScrollView Example
Company Domain: viralandroid.com
Package Name: com.viralandroid.androidscrollviewexample
Minimum SDK: Android 2.2 (API 8 Froyo)

XML Layout File

After creating the project, open the activity_maiinn.xml file of your application from res/layout directory and replace the content with the content given below.
res/layout/activity_main.xml

Now, run your ScrollView application and scroll down the screen. It will look exactly like the output given below.

Output:

Android ScrollView Example

XML 151922274036840888
Home item