ScrollView


 

  1. Static ScrollView
  2. Dynamic ScrollView
  3. Static Horizontal ScrollView
  4. ScrollView Custom Design

 

1. Static ScrollView
Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.
Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

ScreenShot:

scrollview_vert scrollview_vert2

Download_button

 

2. Dynamic ScrollView
Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.
Step 2 : Open src -> package -> MainActivity.java and add following code :

Step 3 : Open AndroidManifest.xml and add following code :

ScreenShot:

dy_scrollview dy_scrollview2

Download_button

 

3. Static Horizontal ScrollView
Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.
Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Open AndroidManifest.xml and add following code :

ScreenShot:

scrollview_hori scrollview_hori2

Download_button

 

4. ScrollView Custom Design
Step 1 : Select File -> New -> Project -> Android Application Project. Fill the forms, create “Blank Activity” and click “Finish” button.
Step 2 : Open res -> layout -> activity_main.xml and add following code :

Step 3 : Open src -> package -> MainActivity.java and add following code :

Step 4 : Create new xml file under res/drawable folder, scrollbar_vertical_track.xml and add following code :

Step 5 : Create new xml file under res/drawable folder, scrollbar_vertical_thumb.xml and add following code :

Step 6 : Open AndroidManifest.xml and add following code :

ScreenShot:

scrollview_custom scrollview_custom2

Download_button