使用故事板在 xcode 4.2 设计滚动视图
问题说明
我有一个垂直滚动的 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.
- 平移:使用 Y 坐标说 -200,然后编辑内容.
- 若要在隐藏部分放置更多内容,请再次平移以显示新的不动产
- 完成后,恢复 ScrollView 的高度和 X、Y 位置的值.
确保滚动视图框架矩形小于包含的视图.
Make sure the scroll view frame rectangle is smaller than the contained view.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tangicaib
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
使用c++17更新时出现G++编译器警告
it1352 06-18 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
复制文件夹/文件而不修改属性?
it1352 07-15 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20 -
在不打开短信界面的情况下从 iPhone 应用发送短信?
it1352 07-25