使用故事板在xcode 4.2中设计scrollview [英] Designing inside a scrollview in xcode 4.2 with storyboards

查看:197
本文介绍了使用故事板在xcode 4.2中设计scrollview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个垂直滚动的uiscrollview - 想象一个标签栏应用程序的关于此应用程序页面,它有点需要滚动视图。它只包含一些图像,一个视频和一些文本(只有视频已被编码 - 其余部分已放入GUI中)。在故事板(界面生成器?)Xcode 4.2中,一切都按照它应该设置并且工作正常,但是视图只有你在屏幕上看到的那么大,是不是可以在故事板中手动安排的项目是最初屏幕外 - 您需要向上滚动?我到目前为止找到的唯一方法是在可见视图上设计它们然后用箭头键向下导航它们。

I have a vertically scrolling uiscrollview - imagine an 'about this app' page of a tab bar app which goes on a bit and requires a scrollview. It only contains a few images, a video and some text (only the video has been coded in - the rest have been placed in the GUI). In storyboard (Interface Builder?) Xcode 4.2, everything is set up as it should be and works fine, but the view is only as large as what you see on the screen, is it not possible to manually arrange in storyboard the items that are initially offscreen - that you need to scroll up to? The only way I've found so far is to design them on the visible view then navigate them down with the arrow keys..

推荐答案

<我感到你的痛苦。我找到的唯一方法是在大小检查器中手动平移滚动视图,以显示您希望可视化编辑的视图部分。

I feel your pain. The only way I found is to manually pan the scroll view in the size inspector to reveal the portion of the view that you wish to visually edit.

使用UIView包含元素,使它们相对于此视图定位。将视图作为子视图添加到0,0的滚动视图。

Use a UIView to contain elements so they are positioned relatively to this view. Add the view as a subview to the scrollview at 0,0.


  1. pan:使用Y坐标说到-200,然后编辑内容。

  2. 将更多内容放入隐藏部分,再次平移以显示新房地产

  3. 完成后,恢复ScrollView的值高度和X,Y位置。

确保滚动视图框架矩形小于包含的视图。

Make sure the scroll view frame rectangle is smaller than the contained view.

这篇关于使用故事板在xcode 4.2中设计scrollview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆