绘制 /布置宽uiview的内容,在uiscrollview内,在ViewController之外



我正在尝试制作一个带有各种UI元素的大型UIScrollView,其元素比iPhone的屏幕更大(更宽)。

我希望能够将这些元素放在UIView中,然后将UIView加载到UIScrollView中。这样,我可以在接口构建器中清楚地看到我对那个大视图的作用。

情节板活跃,我该怎么做?我正在尝试在这里做类似于#2示例的事情,但是使用故事板:

http://agilewarrior.wordpress.com/2012/05/18/uiscrollview-examples/

请参阅Ray Wenderlich的本教程是否有帮助,有关UIScrollView

的很好的细节

http://www.raywenderlich.com/10518/how-to-use-use-uiscrollview-to-scroll-and-zoom-content

如果您正在编程进行布局,请注意此重要评论:

You might ask why we don’t do all of the above in viewDidLoad, and you’d be right to ask. The reason you can’t is that the view size isn’t definitely known until viewWillAppear:, and since you use the size of scrollView when calculating the minimum zoom, things might go wrong if we do it in viewDidLoad.

祝你好运!

最新更新