UIScrollViewはUITableViewの親クラスでもあり、アプリケーションウィンドウより大きなコンテンツをサポートする。スワイプジェスチャーでのスクロールを可能とし、ピンチでのズームなどもできる。
Managing the Display of Content
– (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated- レシーバの起点からのオフセットを指定する。
- 例:
- Information BuilderでUITableView上にSearchBarを置き、実行プログラムで0,44にオフセットするとSearchBarは隠れて表示される。この場合スクリーン上部のステータスをクリックするとオフセットは解除され、SearchBarが表示される。もしくはテーブルを下に引き下ろしてもSearchBarが表示される。
contentOffsetpropertycontentSizepropertycontentInsetproperty
Managing Scrolling
scrollEnabledpropertydirectionalLockEnabledpropertyscrollsToTopproperty– scrollRectToVisible:animated:pagingEnabledpropertybouncespropertyalwaysBounceVerticalpropertyalwaysBounceHorizontalproperty– touchesShouldBegin:withEvent:inContentView:– touchesShouldCancelInContentView:canCancelContentTouchespropertydelaysContentTouchespropertydecelerationRatepropertydraggingpropertytrackingpropertydeceleratingproperty
Managing the Scroll Indicator
indicatorStylepropertyscrollIndicatorInsetspropertyshowsHorizontalScrollIndicatorpropertyshowsVerticalScrollIndicatorproperty– flashScrollIndicators
Zooming and Panning
– zoomToRect:animated:zoomScaleproperty– setZoomScale:animated:maximumZoomScalepropertyminimumZoomScalepropertyzoomBouncingpropertyzoomingpropertybouncesZoomproperty
Managing the Delegate
delegateproperty