StatusBar色调和hidebaronswipe

时间:2015-10-29 15:21:36

标签: ios xcode swift uinavigationcontroller interface-builder

我只想更改statusBar的颜色以跟随navigationController的颜色。

我已经阅读了一些帖子,现在我明白我无法更改statusBar颜色,基本上,我需要有一个视图,并改变该视图的颜色。确定。

所以我的问题是:

我在ViewController中有一个UITableView,这个ViewController嵌入在NavigationController中。

在NavigationController中,我设置了标志Hide Bars:On Swipe

当我滑动TableView时,我的navigationBar消失了,但它也覆盖了我设置为20的高度以模拟StatusBar的视图。

我发现了这个Post,这正是我的问题,我在这篇文章中读到了一个合乎逻辑的解决方案,但OP无论如何工作都没有回答,无论如何,我认为我需要正确使用约束,但这个解决方案在xcode7 swift 2.0上对我不起作用。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我在这篇文章中提供了完美的解决方案:

标记为已接受的解决方案已过时。

Autolayout: Add constraint to superview and not Top Layout Guide?