Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
328 views
in Technique[技术] by (71.8m points)

iphone - How to change the size of a view controller on the storyboard for editing purpose?

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

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.

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?

question from:https://stackoverflow.com/questions/17871614/how-to-change-the-size-of-a-view-controller-on-the-storyboard-for-editing-purpos

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

enter image description here


Xcode 4.x (still valid for newer ones)

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

enter image description here

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:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...