在Interface Builder for Xcode 4中滚动UIScrollView [英] Scrolling through UIScrollView in Interface Builder for Xcode 4
问题描述
在我看来,这似乎是一个常见的问题,但我似乎无法在任何地方找到答案。 这个问题似乎解决了这个问题,但我可以'似乎让解决方案工作,我不确定它是指Xcode 4。
This seems to me as though it would be a common problem, but I can't seem to find the answer anywhere. This question seems to address the issue, but I can't seem to get the solution to work and I'm not sure it's referring to Xcode 4.
在Xcode 4中使用Interface Builder并使用 UIScrollView
,有没有办法在Interface Builder中滚动视图以查看/添加/编辑屏幕可见部分之外的控件?我已经设法使用箭头键向下推几个控件,但现在我看不到它们,因此无法在Interface Builder中操作它们。在IB中滚动视图将是第一奖,但是如果有一种方法甚至可以使用下拉菜单选择控件,或者我可以使用箭头键将它们推回,这至少会是一些问题。谢谢。
When using Interface Builder in Xcode 4 and working with a UIScrollView
, is there a way to scroll the view down in Interface Builder itself to view/add/edit controls that are out of the viewable section of the screen? I've managed to push a couple controls down using the arrow keys, but now I can't see them and therefore can't manipulate them in Interface Builder. Scrolling the view in IB would be first prize, but if there's a way to even select the controls using a drop-down menu or whatever so I can push them back up with the arrow keys, that would at least be something. Thanks.
推荐答案
只是一个有助于Xcode4的解决方法:
Just a workaround which helps in Xcode4:
- 展开位于Interface Builder视图左侧的Objects面板(面板底部有一个小箭头)。
- 从视图层次中拖动UIScrollView并将其放在顶层。
- 现在您可以调整大小以访问更多内容(滚动到该内容对我来说不起作用)。
- 完成添加子视图后在scrollview中,您需要将其大小调整为小于父视图的大小或相同的大小。
- 在您的更改之后,您需要将滚动视图放回到您的层次结构中
- Expand the Objects Panel which resides on the left of the Interface Builder view (there is the tiny arrow at the bottom of the panel).
- Drag your UIScrollView from the view hierachy and place it on the top level.
- Now you can resize it to access more content (scrolling to that content did not work for me).
- When you are done adding child views to the scrollview, you need to resize it back to be smaller or the same size as the parent view.
- After your changes you would need to put back the scroll view where it belongs in your hierachy
这篇关于在Interface Builder for Xcode 4中滚动UIScrollView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!