Popover size with UINavigationController in Storyboard

白昼怎懂夜的黑 提交于 2019-12-18 06:16:40

问题


I have created an iPad app containing a popover view embedded in a navigation controller. I like using Storyboard as much as possible, and setting the "Use Explicit Size" in Xcode give me the correct size of my popover on the iPad. But it does not resize the UINavigationController view and its embedded UIViewControllers when viewing the storyboard in Xcode.

This is quite annoying as the size of my view in Xcode does not correspond to the actual size of the popover.

So, my problem is not setting the correct size of the popover (i also know i can do that with code), but I want the views in storyboard to show the actual size of my views.

What is the correct way to create viewControllers embedded in a navigation controller using storyboard?


回答1:


For the views embedded in the navigation controller, you can change their size in the storyboard by doing the following:

  1. Select the View Controller.
  2. Go to the Attributes Inspector under Simulated Metrics and select Size: Freeform.
  3. Select the View Controller's view.
  4. Go to the Size Inspector and change the width and height.

After that, the view should be sized correctly in the storyboard.

Unfortunately I do not know how to change the size of the navigation controller.



来源:https://stackoverflow.com/questions/15024170/popover-size-with-uinavigationcontroller-in-storyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!