我正在尝试制作一个大的UIScrollView
,其中包含各种UI元素,这些元素比iPhone的屏幕更大(更宽)。
我希望能够将这些元素放在UIView
中,然后将UIView
加载到UIScrollView
中。这样,我可以在Interface Builder中清楚地看到我正在使用那个大视图做什么。
如何在Storyboard处于活动状态时执行此操作?我正在尝试做类似于#2示例的操作,但使用Storyboards:
http://agilewarrior.wordpress.com/2012/05/18/uiscrollview-examples/
答案 0 :(得分:0)
看看Ray Wenderlich的这个教程是否有帮助,关于UIScrollView
的详细信息非常详细:
http://www.raywenderlich.com/10518/how-to-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.