IOS7: Pop ViewController forces the UIImageView to drop

After upgrading my project to iOS7

On Initial Load

  • Restore InApp purchase using swift, iOS
  • Does iOS have a 'Notification Listener'?
  • Xcode 6 Missing Utility Application Template
  • Autolayout programmatically doesn't work
  • image size for UIImages, 1024 x 1024?
  • XAMARIN.IOS UITabBarController in some UIViewControllers
  • when I do a BACK Button and the UINavigationController goes back to the previous page, an ImageView on the top of the screen shifts down.

    images shift down

    I use IB to do my layouts. These are my Simulated Metrics:

    Simulated Metrics

    I have AutoLayout off. Any ideas on what the issue might be? I wasnt sure if anyone wants to see specific code and I didnt want to clutter up the question with too much code.

    Updates: Based on the comment questions, I wanted to make these updates:

    • In no place in the application .h or .m file do I make any changes to the imageview’s sizes or location.
    • In both the viewDidLoad and viewDidAppear I call a user-defined method called recalculateAll but their is no reference at all to any imageview sizes. Just for trying it out I commented out the entire section and ran the code and it still jumps down.
    • In my init I do programatically set some imageviews (you see the #132 in what appears to be a bubble) using their x and y’s.

    Here is a typical navigation I use for moving from the view controller to the tableviewcontroller:

     GetTimeOffByType *showTimeOffReport = [[GetTimeOffByType alloc] initWithNibName:@"GetTimeOffByType" bundle:nil];
        showTimeOffReport.timeOffType = @"Vacation";
        [self.navigationController pushViewController:showTimeOffReport animated:YES];
    

    These are all .xib files, no storyboarding at all. Its basically a view controller which has an embedded UINavigationController with 6 buttons. Each time a button is pressed it pushes a UITableViewController passing different parameters and showing different data. The transition I am using to get back to the original UIViewController is simply the iOS generated BACK button (so no code to show for that)

    Update#2 Hopefully this will help someone solve this wierd behavior. So if I were to click on the table view cell on showTimeOffReport to get the cell detail and then using BACK navigate all the way back it doesnt jump down.

    Update#3 Ok this is something I just discovered : The issue of jumping down or not is related to the translucency of the UINavigationBar. If you have a Translucent = YES it will start from the top of the window. If you have a translucent = NO it will start from the bottom of the UINavigationBar.

    2 Solutions Collect From Internet About “IOS7: Pop ViewController forces the UIImageView to drop”

    You might try setting the new property on UIViewController edgesForExtendedLayout to UIRectEdgeNone.

    Here is a good resource that explains more about how view layouts changed in iOS 7.

    See Apple Documentation

    If you plan to be backwards compatible you will probably need to do some runtime checks and adjust positioning if the device is not running iOS 7.

    This might help you..You can try adding UIViewControllerBasedStatusBarAppearance key and set it’s value NO in your info.plist

    UIViewControllerBasedStatusBarAppearance = NO