Autolayout忽略了iOS7上的UITabBar(条形图下的内容) [英] Autolayout ignores UITabBar (content under the bar) on iOS7

查看:117
本文介绍了Autolayout忽略了iOS7上的UITabBar(条形图下的内容)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在故事板中将UITabBar设置为不透明,但我似乎仍然是透明的。当我使用 setBarStyle 设置我的自定义UITabBarController时,只有OpaqueBlack可用。

I've set UITabBar as Opaque in Storyboard, but i still seems to be transulcent. When I set my custom UITabBarController with setBarStyle there is only OpaqueBlack availible.

但问题最少。无论我做什么,我的视图内容都位于标签栏下方,就像它被ayutolayout忽略一样。在故事板上一切都很好。在运行时搞砸了什么?

But that the least of the problem. No matter what I do, content of my view gets positioned under the tab bar, like it ignored by ayutolayout. On Storyboard everything looks fine. something messes up in the runtime?

哦最重要的事情。问题仅发生在iOS7上!

Oh the most important thing. The problem occurs on iOS7 only!

以下是故事板中的ViewController设置:

Here are my ViewController settings in storyboard:

这里有问题的内容(UITableView)获取位于ios7应用程序的UITabBar下。但在故事板中看起来很好:

And here is problematic content (UITableView) which gets positioned under the UITabBar on ios7 app. Looks fine in storyboard though:

最后是UITableView约束:

And finally UITableView constraints:

推荐答案

将其放在上viewDidLoad ,解决问题:

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0")) {
    [self setEdgesForExtendedLayout:UIRectEdgeNone];
}

这篇关于Autolayout忽略了iOS7上的UITabBar(条形图下的内容)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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