如何在故事板编辑器中调整 UINavigationController 的大小

发布于 2025-01-03 05:56:14 字数 288 浏览 4 评论 0原文

当我想在故事板编辑器窗口中调整 UIViewController 的大小时,我会这样做:

  • 我在 UIViewController 属性检查器中将大小设置为“freeForm”,
  • 然后选择视图并使用大小检查器调整其大小

,然后在故事板窗口中调整 uiViewController 的大小。

接下来,我选择视图控制器,单击:编辑>嵌入>导航控制器,问题是导航控制器是全尺寸的,与 UIViewController 的尺寸不同。我不知道如何调整此导航控制器的大小。

When I want resize an UIViewController in a storyboard editor window I do:

  • I put size to "freeForm" in the UIViewController attributes inspector
  • I select the view and resize her with the size inspector

after that, the uiViewController is resized in storyboard window.

Next, I select the view controller, click on: edit > embeded in> Navigation Controller and the problem is that navigation controller is in full size and not the same size that UIViewController. I don't find how resize this navigation controller.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

在你怀里撒娇 2025-01-10 05:56:14

有一个技巧可以绕过这个限制。将视图控制器添加到故事板,然后将容器视图作为子视图添加到其视图中。将容器视图的大小设置为您想要的导航控制器(及其子级)的大小,然后控制从容器控制器到导航控制器的拖动。然后,您可以通过标识符实例化导航控制器,并且容器视图控制器将被忽略。

There's a trick to get around this limitation. Add a view controller to your storyboard and then add a Container View as a subview to it's view. Size that container view to the size you want the navigation controller (and it's children) and then control drag from the container controller to your navigation controller. You can then instantiate the navigation controller by identifier and the container view controller will be ignored.

颜漓半夏 2025-01-10 05:56:14

您不会调整 NavigationController 的大小 - 它不是 ViewController。它控制 ViewController 的导航。您指定一个初始 ViewController(默认情况下嵌入其中的视图控制器将是初始 ViewController)。然后,您可以在其他 ViewController 中创建 Segue。

You don't resize a NavigationController - it is not a ViewController. It controls the navigation of ViewControllers. You specify an initial ViewController (the one you embedded into it will be the initial viewController by default). You then create segues into other ViewControllers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文