0

Looked around and could not find a solution (non code) for this.

XCode 6.2, iOS 7,8 XIB file layout with Auto Layout. When this is view is presented, it is on top of / over the status bar.

Everything looks good in the XIB Editor, the view is set at 20 for Y, but when presented it seems to ignore this setting, putting the view right on top of the status bar (blended).

This is a regular XIB file, not a storyboard. Have tried many / most of the settings for status bar, etc.

The editor looks like this...

enter image description here

The runtime looks like this

enter image description here

ort11
  • 3,359
  • 4
  • 36
  • 69
  • I think you need to constrain the view to the top layout guide? Or try checking the Under Top Bars in the Extend Edges section. – Rory McKinnel Mar 30 '15 at 16:40
  • Thanks but this does not exist in a non-storyboard xib file, or am I missing something here. – ort11 Mar 30 '15 at 17:10
  • This SO questions has answers which relate to xibs it seems: http://stackoverflow.com/questions/25781169/how-to-fix-status-bar-overlap-issue-in-ios-7. Looks like you have to turn auto layout off and then a DeltaY control lets you set the offset to 20. – Rory McKinnel Mar 31 '15 at 10:03
  • Thanks , but the whole idea is to use Auto Layout for this screen. Will try the code solution and see if it works. – ort11 Mar 31 '15 at 14:01
  • If you do not have a UINavigationController, try embedding one in before this controller or add this controller via a UINavigationController. Aparently that should sort things. – Rory McKinnel Mar 31 '15 at 14:14

2 Answers2

0

Try this:

self.navigationController.navigationBar.translucent = NO;
Javier Flores Font
  • 2,075
  • 15
  • 13
0

Tried a bunch of code solutions, none worked with Auto Layout. Ended up putting a 20 space on top constraint of the Nav Bar in the Editor which looks wrong, but when run, looks correct.

Editor

enter image description here

Running

enter image description here

ort11
  • 3,359
  • 4
  • 36
  • 69