iOS 8 iPad 标签栏高度与 iOS 7 不同
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25770047/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iOS 8 iPad tab bar height is different than iOS 7
提问by kevinl
Does any one know if the official documentation tells us the height of the tab bar on iOS 8 iPad applications?
有谁知道官方文档是否告诉我们iOS 8 iPad应用程序上标签栏的高度?
My app's tab bar frame is (0, 719) (1024, 49) on my landscape iPad app on iOS 8. For iOS 7, it's (0, 712), (1024, 56).
我的应用程序的标签栏框架在 iOS 8 上的横向 iPad 应用程序上是 (0, 719) (1024, 49)。对于 iOS 7,它是 (0, 712), (1024, 56)。
I read in https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.htmlthat the height on iOS 7 ipads is 56 pixels. I'm guessing it's not the same for iOS 8?
我在https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html中读到iOS 7 ipad 的高度为 56 像素。我猜它与 iOS 8 不一样?
回答by Bo A
Apple have changed the iPad tab bar height back to 49pt in iOS 8. An Apple engineer has confirmed the change.The documentation seems to have not updated however.
Apple 已在 iOS 8 中将 iPad 标签栏的高度改回 49pt。Apple工程师已确认此更改。然而,文档似乎没有更新。
So for iPad, the UITabBar heights per iOS version are:
所以对于 iPad,每个 iOS 版本的 UITabBar 高度是:
- iOS 6 and earlier - 49pt
- iOS 7 - 56pt
- iOS 8 and later - 49pt
- iOS 6 及更早版本 - 49pt
- iOS 7 - 56pt
- iOS 8 及更高版本 - 49pt
The tab bar has always been 49pt on iPhone and remains that way.
iPhone 上的标签栏一直是 49pt,并且仍然如此。
回答by juanjo
You can get the size of the tab bar programmatically instead
您可以通过编程方式获取标签栏的大小
tabBarController?.tabBar.bounds.size