Reputation: 4783
I have created a modal segue which links from a view controller embedded in a navigation bar controller to a fresh new view controller which I have named "Search View Controller".
My problem is I can't seem to continue with the same red status bar as I had before. How can I change the status bar from white (nothing there) in the screenshot to red like the predecessor?
I have tried just simply adding a view with the red colour 20 pixels high which does work, but this hacky solution then creates problems when rotating to landscape.
Any ideas?
Upvotes: 0
Views: 1290
Reputation: 1774
as an another approach try this;
UINavigationController
before your controller and set your controller as rootController.Upvotes: 1
Reputation: 776
It's a pretty common problem, really. The only thing that worked for me was the hack found here: http://blog.ijasoneverett.com/2013/09/ios-7-bugs-the-status-bar-and-modal-view-controllers/ which is slightly (but not much more) elegant :)
let fixItView = UIView()
fixItView.frame = CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, 20);
fixItView.backgroundColor = UIColor.redColor() // your colour
view.addSubview( fixItView )
That's the basic idea. Try adding that small 'fixItView' to your navigation bar.
Upvotes: 3