IOS7: Pop ViewController forces the UIImageView to drop
After upgrading my project to iOS7
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.
I use IB to do my layouts. These are my 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
viewDidAppearI call a user-defined method called
recalculateAllbut 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
initI 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.
- Change a UILabels text with a UISliders value
- Asynchronous loading - UITableView and Firebase
- How to check for data in a child, in a child in Firebase
- Swift 2 - Filter array of strings, including “like” condition
- iOS Receipt Validation through Node.js using lambda
- Making square crop of UIImage causing image to stretch
2 Solutions Collect From Internet About “IOS7: Pop ViewController forces the UIImageView to drop”
You might try setting the new property on UIViewController
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
- How do I declare an array as a constant in Objective-c?
- Attributed string with custom fonts in storyboard does not load correctly
- Failed to save to data store: The operation couldn’t be completed. (Cocoa error 133020.)
- Method does not reach Completion Block
- How to add a UIImageView over a MPMoviePlayerController | iOS | Objective C
- How to use Core Data model subclasses outside a Core Data context?
- App could not authenticate with Facebook and Firebase after conversion to swift 3 syntax
- What is this double underscore in Cocoa
- How to Add image in custom cell using settings.bundle in iPhone?
- How to center my current location in MKMapView?
- Firebase Upgrading From 2.5.1 to 3.2.1
- Get the type of AnyObject dynamically in Swift
- requestedUpdateDidBegin just called once
- Tap Recognition for UIImageView in the UITableViewCell
- What is the purpose of 'Notes' under Document in XCode