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

后端 未结 4 1274
暖寄归人
暖寄归人 2021-02-02 06:17

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 p

相关标签:
4条回答
  • 2021-02-02 06:55

    To easily switch between various iOS device sizes, use a Simulated Size Metric:

    Attributes Inspector > Simulated Metrics > Size:

    Size via Simulated Metrics

    0 讨论(0)
  • 2021-02-02 07:02

    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

    0 讨论(0)
  • 2021-02-02 07:03

    click on 'View Controller' option on the top of the displayed storyboard and select proper size in Attributes Inspector->Simulated Metrics

    0 讨论(0)
  • 2021-02-02 07:20

    You Can Change your view controller from selecting view controller, then go to file inspector.There you will see the checkbox "Use size classes". By unchecking it, you can change the size of view controller .......

    Note: for the first time using of xcode

    0 讨论(0)
提交回复
热议问题