Black bar overtop navigation bar

2019-08-14 23:31发布

问题:

Im creating an app that uses a navigation controller for a couple of the views. When i finally figured out how to set it up this happened:

So obviously the black bar at the top is not supposed to be there, but i dont know what to do to get rid of it. Any ideas?

回答1:

This is also commonly seen when setting up a view programmatically. Be sure to use:

myView.frame = self.view.bounds;

and not:

myView.frame = self.view.frame;


回答2:

Looks like your view thinks it's supposed to have a status bar. Go into the XIB file and under the fourth tab in Simulated Metrics set Status Bar to None.