调整故事板中 UIViewController 的大小 [英] Resize of UIViewController in storyboard

查看:35
本文介绍了调整故事板中 UIViewController 的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想调整故事板中 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:

  1. 拖动一个UIViewController(这需要一个UIView,所以不需要添加另一个UIView,除非你需要更多)立>
  2. 在 StoryBoard 上选择 UIViewController 并将 size 属性设置为 Freeform
  3. 选择 UIView 并设置高度和宽度值.
  1. Drag a UIViewController (this takes a UIView along with it, so no need to add another UIView unless you need more)
  2. Select UIViewController on StoryBoard and set size property to Freeform
  3. 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屋!

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