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
545 views
in Technique[技术] by (71.8m points)

ios - Popover size with UINavigationController in Storyboard

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?

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

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.


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

...