andreamazz / AMScrollingNavbar

Scrollable UINavigationBar that follows the scrolling of a UIScrollView
MIT License
6.05k stars 633 forks source link

NavigationController title off on iPhone X #266

Closed cjrieck closed 7 years ago

cjrieck commented 7 years ago

Hi there! Thank you for the awesome library! I was running my app using the Xcode 9 GM and iPhone X simulator when I noticed the title was a bit close to the notch in the sim:

screen shot 2017-09-15 at 10 35 21 am

This only happens after the navbar collapses and expands. It's starts out ok.

It could be an issue is in the statusBarHeight here:

var statusBarHeight: CGFloat {
    return CGFloat.minimum(20, UIApplication.shared.statusBarFrame.size.height)
}

Not sure how big the status bar height is now, but The status bar height is 44 for iPhone X, so it seems like the 20 needs to be updated for iOS 11 and iPhone X. I confirmed that returning only the UIApplication.shared.statusBarFrame.size.height fixes the issue. Any help would be greatly appreciated!

andreamazz commented 7 years ago

The status bar height is 44 for iPhone X, so it seems like the 20 needs to be updated for iOS 11 and iPhone X. I confirmed that returning only the UIApplication.shared.statusBarFrame.size.height fixes the issue. Any help would be greatly appreciated!

Great to hear that. I'm trying to remember why that minimum(20, is in place, but for now, nothing comes to mind 😬

cjrieck commented 7 years ago

No worries! Thanks for the help and speedy response!

andreamazz commented 7 years ago

👍 Released 4.0.1 with the fix.

sbelmeha commented 6 years ago

What about this fix for version 3.x ?

andreamazz commented 6 years ago

Sure, feel free to open a pull request.