andreamazz / AMScrollingNavbar

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

ios11 issue #285

Open mervekeles opened 6 years ago

mervekeles commented 6 years ago

Hi,

I am using paging menu with a UIScrollView and the AMScrollingNavbar works fine with ios 10. But on iOS 11 I couldnt hide the nav bar with scroll. Anyone had the same issue?

THANKS!

andreamazz commented 6 years ago

Hi @mervekeles Can you provide more detail? A sample project showing the issue would be great too. Thanks

toseefkhilji commented 6 years ago

Hi @mervekeles We also facing same issue.

Please find attached Screenshots for iOS 10 & iOS 11 diff.

ios 11

ios-10
Movsisyan commented 6 years ago

Hi.

We have the same issue.

Here is what I have find out. Above mentioned bug doesn't appear in frameworks version 3.4.1 but it does on latest version. The problem with version 3.4.1 is iPhone X nav bar height issue.

Also it is important to note that the latest version bug doesn't appear in new build projects. It seems that framework get conflict with other used frameworks.

Hear is the list of frameworks used in our app.

Cartfile github "realm/realm-cocoa" github "Instagram/IGListKit" ~> 2.0.0 github "Hearst-DD/ObjectMapper" ~> 2.2 github "SwiftyBeaver/SwiftyBeaver" github "Moya/Moya" ~> 8.0.0 github "andreamazz/AMScrollingNavbar" == 3.4.1 github "onevcat/Kingfisher" ~> 3.0 github "malcommac/SwiftDate" ~> 4.1.1 github "BranchMetrics/iOS-Deferred-Deep-Linking-SDK" github "aws/aws-sdk-ios"

Podfile pod 'RMQClient', '~> 0.10.0' pod 'Shimmer' pod "CleverTap-iOS-SDK" pod 'FBSDKShareKit' pod "Texture", '= 2.2' pod 'ActiveLabel' pod 'GPUImage'

Latest version bug. navbar bug

3.4.1 version bug.

3 4 1 initial_state 3 4 1
andreamazz commented 6 years ago

Thank you @Movsisyan for these details. So, to recap: Happens on versions greater then 3.4.1, and only if coupled with those libraries? @toseefkhilji do you see a library that you include as well?

Movsisyan commented 6 years ago

Except latest version I have tried only on 3.4.1.

And yes it happens when coupled with those libraries.

lpbas commented 6 years ago

Hello. I have faced the same issue on my app, but only in some conditions (I'm using a TabBarController so each of my VCs has its own scrolling navigation controller). One of them that I was able to pinpoint, is when ios 11 Large Titles are enabled, the title does not fade out (but moves upwards) and stays, as in the screenshots provided by @toseefkhilji

Screenshot: https://imgur.com/a/kbVO0EH

This only happens in my app when the previous VC has Large Titles enabled.

joshbernfeld commented 5 years ago

This problem is not because of framework conflicts. This happens when your navigation controller view is not the exact same size as your application window. For instance your navigation controller could be smaller because you have a static tab bar beneath it. The problem arises because of the following code:

// Extended status call changes the bounds of the presented view
var extendedStatusBarDifference: CGFloat {
  return abs(view.bounds.height - (UIApplication.shared.delegate?.window??.frame.size.height ?? UIScreen.main.bounds.height))
}

When the in call status bar is not visible this should always return 0 and when it is visible it should return 20. In this case, when the call status bar is not visible we are getting some high positive number because the navigation controller view is not the exact same size as the application window. The solution is to replace the code with the following:

// Extended status call changes the bounds of the presented view
var extendedStatusBarDifference: CGFloat {
  let window = UIApplication.shared.delegate?.window
  return abs((window??.rootViewController?.view.frame.size.height ?? UIScreen.main.bounds.height) - (window??.frame.size.height ?? UIScreen.main.bounds.height))
}

This uses the rootViewController to check for the difference instead.

Note: The above gif example has a tab bar present.

andreamazz commented 5 years ago

@L4grange were you able to test what @joshbernfeld suggested?

lpbas commented 5 years ago

@andreamazz Unfortunatelly in my app the suggestion that @joshbernfeld posted did not fix the issue. The title is still visible. If I disable the Large titles on the previous VC, then the problem disappears.

joshbernfeld commented 5 years ago

Im guessing this still causes problems for large titles, you might want to try returning zero from extendedStatusBarDifference to see if that fixes it.