iOS 8.3 pushViewController shows empty view first, then view is shown - ios

iOS 8.3 changed the behavior of pushViewController to show blank view first, then the view is shown. Any tips to fix this issue?
Same code on different iOS versions
iOS 8.3 broken behavior: https://vid.me/4JDf
iOS 8.2 expected behavior: https://vid.me/qgvA
The basic code that pushes the view:
[self.navigationController pushViewController:view animated:YES];
PS: The VC's code is under NDA, sadly I can not share it.

Please set background color for view.view any color except clear color

This seems like a layout clash issue in the new view. Commenting out some layout based code solved the issue. Basically we had more layoutIfNeeded than needed.
[self.view layoutIfNeeded];

Related

Dark background behind UINavigationBar in push transition from UICollectionViewController with iOS 7.1

I'm having a little problem when trying to go to the next UIViewController from a UICollectionViewController. The problem is: While the next view is pushed, a black background seems to be added behind the right side of the navigation bar. I tried to replace the next view controller but the problem is still there. But when replacing the UICollectionViewController with another one, the problem vanishes.
Note: this problem seems to be an iOS 7.1 bug. Because i don't remember that it happened before I updated my devices.
Here is a Video of my problem if you didn't understand me
Anyone can help ?
Thank you all in advance and sorry for my english,
Bader
Setting self.navigationController.view.backgroundColor to the color you want will solve this problem.
I had exactly the same problem.
It's a bug.
UINavigationController view has a black background, and it spoils translucent Navigation Bar at transition time.
To resolve this issue, you should change background of UINavigationController in code by this way:
self.navigationController.view.backgroundColor = [UIColor whiteColor];
Or set view color of UINavigationController in Interface Builder:
Ok, i finally knew what caused this problem. That was because i added an ILTranslucentView as a subview of a UICollectionView cell. Also, using a UIToolbar instead causes the same issue ( i still believe this is an iOS 7.1 bug because this wasn't happening before ).
Solution: remove any UIToolbar from your view controller.
While the next view is pushed, in that view controller’s .m file remove self.edgesForExtendedLayout = UIRectEdgeNone; if you wrote in your code.
self.navigationController.navigationBar.translucent = NO

Top half of UINavigationBar on iOS6 not responding to taps

I'm working on an iPhone app and have the strangest issue.
On iOS 6, buttons on the navigation bar are completely ignoring taps in the top half. Have a look at the image below, I have roughly selected tap areas of my navbar buttons:
https://www.dropbox.com/s/izs6ic5jlubm1yk/navtap_problem.png
Here's some, potentially useful, information:
the app supports iOS 6 and 7
the app is not using autolayout (working with deltas instead)
this issue is present only on iOS 6, it's working fine on iOS 7
the issue is present in all views across the app (that have a navigation bar on top)
the issue present in both navigation bars that are manually added in IB as well as in navigation bars that are coming from the UINavigationController
the problem is not present if I directly start the app from one of affected view controllers
the problem is present when I start the app through my empty InitialViewController and load another VC
I'm using ECSlidingViewController and loading the real VC (that users will see) from the InitialViewController like this:
self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:#"SearchSplitViewNavigationController"];
[self resetTopView];
It looks like something invisible is covering the top half of the navigation screen. I checked the contents of self.view.subviews, but didn't see anything there.
Any ideas what might be causing this? Or what else could I check?
If you are including any element programmatically, then that element isn't using the deltas you are including through the storyboard.
For these elements you must test for the iOS version you're in and adjust the delta in code.
Check this: Best Way to check for iOS 7 or earlier? for help on the version checking.
I've found a solution (not the cause though). This awesome library helped me a lot to identify the problem.
There was actually a transparent UIView sitting on top of my navigation bars. It was located at 0,20 and had a height of 20 points.
That view is not in the self.view.subviews array, but doing [self.view bringSubviewToFront:myNavigationBar] seems to do the trick...

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 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.
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

Using MGSplitViewController Inside Tab

I have a UISplitViewController inside a tab bar. I know this is not officially supported by Apple, but it did work for iOS 5/6. In iOS 7 I am getting a grey bar at the bottom of the screen similar to the one shown in this post:
UISplitView with UITabbar
I followed the advice and tried the MGSplitViewController. It seemed to work perfectly, I merely changed my type and presto it all came up as expected. A new problem occurs however. The other tabs have stopped rotating. The tab containing the mgsplitview rotates, the others don't.
Has anyone experienced this before? Is there a quick solution?
Thanks
change height -= statusBarHeight;
with
if (NSFoundationVersionNumber <= NSFoundationVersionNumber_iOS_6_1) {
height -= statusBarHeight;
}
in MGSplitviewController
This worked for me also:
I subclassed UISplitViewController and added the line below to viewDidLoad and that fixed the grey line.
self.extendedLayoutIncludesOpaqueBars = YES;

Blank View Controller When Dismissing Interstitial Flurry Ad On iOS 5/5.1

I implemented FlurryAds on my iOS app, and created an Interstitial/Full-screen ad. Requesting and showing the ad works fine, but after I close the ad, all of my ViewController elements that were inside the .xib file become invisible. I know they are still there because if I tap on the screen the buttons that were there still respond.
Any ideas on how to solve this?
Edit: Forgot to post more information, I'm using XCode 4.5.2, my project is using ARC, no Storyboard, and the Flurry SDK is 4.0.6
This bug arises when you enter the viewController using
"[self presentModalViewController: viewController animated:YES]"
Try to use this
"[self.navigationController pushViewController: viewController animated:YES]"
Hope this will help you
:)
Ok, I finally figured out the problem and it was because of my misunderstanding how view controllers work.
All my view controllers inherited from a custom view controller, which had a full background image being added on viewDidLoad, which then faded out. All I had to do was separate adding the full background image on viewDidLoad, but having the fade out animation inside the viewDidAppear method.

Resources