IOS 10 Beta allows navigation buttons and title bar to fade on pushViewController

EDIT: Watch a video about my problem here: https://www.dropbox.com/sh/lzgs9mahx5mea13/AADLYfLQix7MDleDN1ER81qVa?dl=0

I had a real-time app in the app store that works fine on iOS 9.

However, on iOS 10 (tested on the iPhone 6s device with the latest beta version), when a cell on the main viewing controller is selected and the detailed view is โ€œpressedโ€, the title of the navigation bar and buttons of the navigation bar disappear.

Only the back button is displayed.

Even if I go back to the wizard by clicking the back button or bouncing back, they wonโ€™t go back. After you cast it back, even the names of the "wizard" and the panel buttons disappeared. I do not know how to fix this problem, since there are no errors.

In my code, I do not hide the navigation bar anywhere and do nothing with the navigation controller.

Screenshots from the view hierarchy: enter image description here

Notice how the title and my right buttons on the panel are located behind several other views. the back button is at the very beginning. This shows that the buttons and the title are not hidden, they are covered by three additional views: UIVisualEffectView, _UIVisualEffectBackdropView and _UIVIsualEffectFilterView

Also in the video you will notice that if I get back, cancel the swipe, the panel buttons will return. But the name does not have.

enter image description here

enter image description here

After returning to the master, note that the material of the main navigation barrier is superimposed by two other types of private class: enter image description here

I program programmatically: Corresponding code:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ [self.tableView deselectRowAtIndexPath:indexPath animated:YES]; PlaylistDetailViewController *pdvc = (PlaylistDetailViewController*)[self.storyboard instantiateViewControllerWithIdentifier:@"PlaylistDetailViewController"]; pdvc.indexPath=indexPath; [self.navigationController pushViewController:pdvc animated:YES]; } 
+6
source share
7 answers

In fact, I just figured a minute ago. I am using a custom GKFadeNavigationController from github.com/gklka/GKFadeNavigationController . Copy it, which fixes the problem.

0
source

I also ran into this problem and all the suggested solutions:

  • too complicated
  • does not work

In the end, I found out that this was caused by an updated drawing cycle for the UINavigationBar in iOS10.

To get around this, I had to fix this:

 self.navigationController.navigationBarHidden = YES; self.navigationController.navigationBarHidden = NO; 

This basically forces the navigation bar to redraw.

It's still annoying how they can just release a new version of the OS that breaks something meaningful.

+4
source

I ran into the same problem, but this was caused by using a custom UINavigationBar adding blur. It seems like something has changed with iOS10, that when you add a title or buttons to the navigation bar, they are added at a specific index, rather than being added to the subview stack.

I managed to overcome this problem by overriding the insertSubview:atIndex and making sure that blurView is always inserted at the end of the subtitle stack.

+3
source

I had the same problem as now. There are some changes that I made in my code and its work. In my viewWillAppear write navigation code in dispatch_async

 dispatch_async(dispatch_get_main_queue(), ^{ //BACK BUTTON CALLING //NAVIGATION TITLE }); [super viewWillAppear:animated]; 

This will help you set your header and return button using the main queue.

+1
source

The same problem occurs if you use the LTNavigationBar library ( https://github.com/ltebean/LTNavigationBar )

The workaround for me was to change the code in UINavigationBar + Awesome.m:

 Replace [[self.subviews firstObject] insertSubview:self.overlay atIndex:0]; with [[self.subviews firstObject] insertSubview:self.overlay atIndex:self.subviews.count -1]; 
0
source

Swift 3.0 workaround for this:

Subclass UINavigationBar and override insertSubview (_ view: UIView, by index: Int)

  override func insertSubview(_ view: UIView, at index: Int) { if let _ = view as? UIVisualEffectView { super.insertSubview(view, at: 0) } else { super.insertSubview(view, at: self.subviews.count - 1) } } 
0
source

I found a tapeworm for my work. Create a view (viewBackground) with all the images and colors that match the navigation bar, and then convert them to an image and use it as a background.

 UIGraphicsBeginImageContextWithOptions(viewBackground.bounds.size, viewBackground.opaque, 0.0); [viewBackground.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); [[UINavigationBar appearance] setBackgroundImage:img forBarMetrics:UIBarMetricsDefault]; [self.navigationController.navigationBar setBackgroundImage:img forBarMetrics:UIBarMetricsDefault]; 
-one
source

All Articles