开发者

Does UIScrollView have a special content view for making the scrolling possible?

I wonder if UIScrollView has got an "h开发者_如何转开发idden" subview acting as an container for the content. If I scroll a scroll view, is that content view moved up/down in the scroll view? Or is the scrolling offset applied to the bounds of that UIScrollView instance?

Or: Does UIScrollView use an additional view as container, or is all content added directly to the view? The documentation doesn't tell much about wether it has a content container or not.


UIScrollView doesn't have a content container but it is standard practice to create one yourself and add all your subviews to it. It's not necessary, though, at least as long as you use the scroll view just for scrolling. If you need the zooming functionality, too, having one content view often simplifies things because the delegate method viewForZoomingInScrollView: requires you to return a single view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜