调整故事板中 UIViewController 的大小 [英] Resize of UIViewController in storyboard
问题描述
我想调整故事板中 UIViewController
的大小,以便我可以将其 UIViewController
用作弹出视图.
I want to resize a UIViewController
in the storyboard so I can use its UIViewController
as a popover view.
在大多数网站上,我可以了解到这些操作是:
On most sites I can read that the actions are:
- 在故事板中拖出一个
UIViewController
- 在上面放一个
UIView
- 设置自由格式的属性并调整大小
但是在我的 iOS 5.1 中这不起作用,即使是一个只有一个 UIViewController
的新项目.我在程序中忘记了什么?
But in my iOS 5.1 this does not work, even with a new project with only one UIViewController
.
What did I forget in the procedure?
推荐答案
我们按照以下步骤来实现:
We follow the following steps to achieve the same:
- 拖动一个
UIViewController
(这需要一个UIView
,所以不需要添加另一个UIView
,除非你需要更多)立> - 在 StoryBoard 上选择
UIViewController
并将 size 属性设置为Freeform
- 选择
UIView
并设置高度和宽度值.
- Drag a
UIViewController
(this takes aUIView
along with it, so no need to add anotherUIView
unless you need more) - Select
UIViewController
on StoryBoard and set size property toFreeform
- Select the
UIView
and set the height and width values.
如果这没有帮助,您可能需要删除 UIViewController
附带的 UIView
,添加一个新的 UIView
并重复#2,以及上面的#3.
If this doesn't help, you might want to delete the UIView
that comes with the UIViewController
, add a fresh UIView
and repeat #2, and #3 above.
这篇关于调整故事板中 UIViewController 的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!