iOS 7 content shifting up by 20 points due to transparent statusbar

236 views Asked by At

Ever since I have upgraded to iOS 7, all my content have shifted 20 points up, and I cant seem to get this fixed. I have looked elsewhere on ways to shift the content down, from adjusting the window, to the view, but none seem to affect the content views. Can someone please tell me what to do to get the views shifted down.

Here are some screenshots:

Notice the window red background colour showing through at the bottom:

enter image description here Notice how the pattern repeats at the bottom of the login page:

enter image description here

2

There are 2 answers

0
Bikram Thapa On

If your project doesn’t use Auto Layout, issues caused by the status bar differences between iOS 6 and iOS 7 can be resolved by using Springs, Struts, and iOS 6/7 Deltas.

Solution for you is to move the content down by 20px but the content wasn’t under the status bar in iOS 6.

To remedy this, use iOS 6/7 Deltas to set a negative Y Delta, equal to the number of points that we moved the content down for iOS 7. For example, if we moved content down 20 points for iOS 7, then we set a Y Delta of -20 points.

Follow this link to get the correct direction as per your code.

Hope this will help you a lot.

Good Luck.

0
kushyar On

Could be the result of the translucency in iOS 7. Can you try the code below in your ViewController

-(void)viewDidLoad {
    [self.navigationController.navigationBar setTranslucent:NO];    
}