Graphics Programs Reference
In-Depth Information
Using UIScrollView
When you want to let the user scroll around your view, you typically make your view the
Figure 6.11 Object diagram
Scroll views are typically used for views that are larger than the screen. A scroll view
draws a rectangular portion of its subview, and moving your finger, or
panning
, on the
scroll view changes the position of that rectangle on the subview. Thus, you can think of
the scroll view as a viewing port that you move around a virtual world (
Figure 6.12
). The
size of the scroll view is the size of this viewing port. The size of the area it can view is the
UIScrollView
's
contentSize
, which is typically the size of the
UIScrollView
's
subview.
Figure 6.12 UIScrollView and its content area