故事板中 UINavigationController 的弹出框大小 [英] Popover size with UINavigationController in Storyboard

查看:23
本文介绍了故事板中 UINavigationController 的弹出框大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个 iPad 应用程序,其中包含嵌入在导航控制器中的弹出视图.我喜欢尽可能多地使用 Storyboard,并且在 Xcode 中设置 "Use Explicit Size" 会给我在 iPad 上的弹出框的正确大小.但在 Xcode 中查看情节提要时,它不会调整 UINavigationController 视图及其嵌入的 UIViewControllers 的大小.

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.

这很烦人,因为我在 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?

推荐答案

对于嵌入在导航控制器中的视图,您可以通过执行以下操作更改它们在故事板中的大小:

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

  1. 选择视图控制器.
  2. 转到 Simulated Metrics 下的 Attributes Inspector 并选择 Size: Freeform.
  3. 选择视图控制器的视图.
  4. 转到尺寸检查器并更改宽度和高度.

之后,应该在情节提要中正确调整视图的大小.

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.

这篇关于故事板中 UINavigationController 的弹出框大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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