Android Tutorial

(avery) #1
Android Tutorial 255

Adding Scrolling Support


One of the easiest ways to provide vertical scrolling for a screen is
by using the ScrollView (vertical scrolling) and HorizontalScrollView
(horizontal scrolling) controls. Either control can be used as a
wrapper container, causing all child View controls to have one
continuous scrollbar. The ScrollView and HorizontalScrollView
controls can have only one child, though, so it’s customary to have
that child be a layout, such as a LinearLayout, which then contains
all the “real” child controls to be scrolled through. Figure shows a
screen with and without a ScrollView control.


A screen with (right) and without (left) a ScrollView control.

Free download pdf