Inherits from
Conforms to
Framework
/System/Library/Frameworks/ UIKit.framework
Availability
Available in iOS 2.0 and later.
Declared in
UIScrollView.h
Related sample code

 

概述:

UIScrollView类,提供支持,来显示比应用窗口更大的内容。它让用户使用类似刷卡的动作来滚动内容。

UIScrollView是一些UIKit类的父类,包括 UITableView and UITextView.

UIScrollView对象的中心概念是,一个view可根据内容的大小来自我调整。

子类能够重载 touchesShouldBegin:withEvent:inContentView:, pagingEnabled, and touchesShouldCancelInContentView: 方法,来影响scrollView怎么处理滚动手势。

一个滚动视图也处理缩放和移动。

UIScrollView必须采纳 UIScrollViewDelegate协议。为了缩放和移动能有效的工作,必须实现

viewForZoomingInScrollView: andscrollViewDidEndZooming:withView:atScale:

此外,最大和最小尺寸,必须不同。

重要:

你不应该嵌入UITableView或者UIWebView对象。如果你那样做了,意外的情况会发生。

任务:

管理内容的显示: