iOS 7状态和导航栏在故事板中的高度不同于应用程序 [英] iOS 7 status and navigation bar different height in storyboard than in app

查看:146
本文介绍了iOS 7状态和导航栏在故事板中的高度不同于应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个视频控制器,而不是模态显示,因此全屏。

This is a view controller than is modally presented and therefore full screen.

在故事板中,顶部布局指南位于 Y:64 。当状态栏 height:20 并且导航栏 height:44

In the storyboard, the "top layout guide" is at y:64. That is what I would expect when the status bar is height:20 and navigation bar is height:44.

然而,当应用程序运行时,顶部布局指南为 y:52 。我不知道它是如何或为什么会失去12分。

However, when the app runs, the "top layout guide" is y:52. I have no idea how or why it's losing 12 points.

推荐答案

当您使用Apple的导航控制器插入导航栏时,它将根据您的方向有不同的高度。例如,导航栏为纵向44点,横向为32点。在你的情况下,我猜你的应用程序何时运行,它是横向的,因此顶部布局指南是y:52(32 + 20)。

When you use Apple's Navigation controller which inserts a navigation bar, it will have different heights based on your orientation. For example, the navigation bar is 44 points in portrait and 32 points in landscape. In your case, I'm guessing when your app runs, it is in landscape, thus the "top layout guide" is y:52 (32+20).

请参阅此相关文章:带旋转的NavigationBar。

这篇关于iOS 7状态和导航栏在故事板中的高度不同于应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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