UINavigationbar

iphone 7plus, ios 11 beta 6, i installed an app from appstore, why this app have no title and back button?

maybe this app's interface created by xib?

Replies

run it on iOS 10.3 it's normally 😮

is it because the large title?

is it not supported in xib created?

There has a problem with UINavigationbar(maybe is bug).

We create a subclass of UINavigationbar, but it barPosition default in UIBarPositionTop on the iOS 11 GM, we not sure what's happening, and this is sulution:

  1. Confirm UINavigationBarDelegate protocol with you ViewController.
  2. Assign this ViewController to UINavigationbar instance delegate property, and make offset with status bar (now status bar top bounds is -20? Looks like bug)


CGFloat offset = 0;
if ([[UIDevice currentDevice].systemVersion floatValue] >= 11) {
    navgationView.delegate = self;
    offset = 20;
}
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[nav]|" options:0 metrics:nil views:@{@"nav":navgationView}]];
[self.view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|-offset-[nav(65)]" options:0 metrics:@{@"offset":@(offset)}


3. implementation UINavigationBarDelegate protocol


- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar {
    return UIBarPositionTopAttached;
}


Now, all good!


This really really really looks like a bug!!!! Apple should check it out, OR , new API ?