Javatpoint Logo
Javatpoint Logo

Android ScrollView (Vertical)

The android.widget.ScrollView class provides the functionality of scroll view. ScrollView is used to scroll the child elements of palette inside ScrollView. Android supports vertical scroll view as default scroll view. Vertical ScrollView scrolls elements vertically.

Android uses HorizontalScrollView for horizontal ScrollView.

Let's implement simple example of vertical ScrollView.

activity_main.xml

Now, drag ScrollView from palette to activity_main.xml file and place some palette element inside it.

File: activity_main.xml

Activity class

In activity class, we have not changed any code.

File: MainActivity.java

Output

android ScrollView Vertical 1
android ScrollView Vertical 2




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA