如何更改故事板上视图控制器的大小以进行编辑? [英] How to change the size of a view controller on the storyboard for editing purpose?

查看:137
本文介绍了如何更改故事板上视图控制器的大小以进行编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的问题,我花了无数个小时试图解决这个问题。

I have a simple question and I have spent countless hours trying to figure this out.

如何更改Xcode Storyboard中视图控制器的大小以进行编辑?

How can I change the size of a view controller in an Xcode Storyboard for editing purposes?

我有我希望将大型表格/问卷放在我的视图控制器上,而我根本无法使用故事板给我的当前大小。

I have a large form/questionnaire I would like to place on my view controller, and I simply cannot work with the current size the storyboard gives me.

此外,没有提供尺寸(Inferred,FreeForm,Retina 3.5和Retina 4)足够大!

Furthermore, none of the provided sizes ("Inferred", "FreeForm", "Retina 3.5", and "Retina 4") are big enough!

有没有人能解决我的问题?

Does anyone have a solution to my problem?

推荐答案

Xcode 5.x +(包括6.x和7.x)



从Xcode 5及更高版本开始,有一个更简单的解决方案。在 UIStoryboard 中,您只需选择 UIViewController ,然后直接转到第五个标签。只需将模拟大小固定更改为自由格式。之后,您应该看到宽度和高度字段,如下图所示:

Xcode 5.x+ (including 6.x and 7.x)

From Xcode 5 and beyond, there's a even easier solution. Inside the UIStoryboard, you can simply select your UIViewController and go directly to the fifth tab. Just change the Simulated Size from Fixed to Freeform . After that, you should see the Width and Height fields, as the image below:

选择视图控制器,在InterfaceBuilder的第四个选项卡中,选择自由形式。

Select your view controller, and in the fourth tab of InterfaceBuilder, select 'freeform' in size.

< img src =https://i.stack.imgur.com/7RDTo.pngalt =在此处输入图像说明>

选择自由格式后,现在能够在 UIViewController 中更改主视图的大小。只需选择控制器的主视图并在第五个选项卡中更改其框架,如下所示:

After freeform is selected, you now are able to change the size of the main view inside your UIViewController. Just select the main view of the controller and change its frame in the fifth tab, like this:

这篇关于如何更改故事板上视图控制器的大小以进行编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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