0

So our app is built using XIB interfaces, not story boards. We have XIBs for iPhone and iPad.

Since the iOS7.1 update the, iPhone xibs are now bigger in interface builder and far too tall when deployed on a device.

The height is all wrong, the XIB is far too tall now. For example, backgrounds appear to go way outside the View when set to fill. When deployed on the phone everything is shifted down about the height of the top nav bar.

If I add/remove Top/Bottom Bars for the View in Interface Builder things shift around but not in a way that makes sense. My app has a nav bar, if I tell the interface builder it has a nav bar then the height of the xib grows a further 80 or so pixels. If I tell the interface builder it has no nav bar, everything shifts up properly but the height of the View is still so tall that backgrounds and stuff near the bottom go off screen.

So for the very vague issue but we are pulling hair over this.

UPDATE - It seems Opaque Navigation Bar fixes half the problem. We had every interface set with a Translucent Nav Bar. Those do not appear to take up space in IOS7.1 but they did in IOS7.0.

The problem now is still height. It still seems internally the height is broken or starts from a new origin.

In view did load, on a view with a opaque nav bar, on iPod Touch:

  • self.view.frame.origin.y is showing 0

  • self.view.frame.size.height is showing 256

  • Nav bar origin.y = 20

  • Nav bar size.height = 32

This totals 308, missing 12 pixels.

Halsafar
  • 2,540
  • 4
  • 29
  • 52
  • This is a guess, but i read it somewhere today! What apple has done is when you have a navigation controller attached to your interface, then the y-coordinate has it's origin 64 pixels the original one. i.e. 44 pixels for the navigation bar and 20 pixels for the status bar. – Harsh Mar 12 '14 at 20:06
  • Everything was working fine though even up to IOS7. So far it seems Translucent Nav Bars in interface builder previously took up space but now they do not (which actually makes sense). So switching to Opaque Nav Bars in interface builder fixed half the height problem. However the view is still to tall. Widgets constraint to the bottom of the view in interface builder show up about 20px from the bottom on the device. I have an interface which is just a UIWebView which takes up the entire View and once deployed there is a 20px strip on the bottom empty. – Halsafar Mar 12 '14 at 20:24

1 Answers1

0

Create auto layout constraints in IB or programmatically that align the top of the main view in each XIB file to the "top layout guide" and bottom of the views to the "bottom layout guide." This solved a very similar problem when moving from iOS 6 to iOS 7 in several of my apps.

mharper
  • 3,212
  • 1
  • 23
  • 23
  • This isn't working. The interface builder the UI looks fine. When deployed everything shifts up 20px leaving a strip at the bottom of every view that cannot be filled it seems. Even a UIWebView set to take up the entire View is cut off at the bottom. – Halsafar Mar 13 '14 at 17:59