andreamazz / AMScrollingNavbar

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

Navigation bar background color changing #402

Open Okizeme opened 3 years ago

Okizeme commented 3 years ago

Describe the bug I updated from version 5.6.1 to 5.7.2 and I now have a scrolling nav bar that change color after scrolling or navigating to another controller. Note that my nav bar has it's color set using appearance at the beginning of the app, but somehow it changes from white to grey. This bug was probably introduced by #392 or #399.

To Reproduce Steps to reproduce the behavior:

  1. Set the background/tint color of all UINavigationBar to a light color using appearance when the app starts
  2. Make a controller with a scrollview that has a dark background color and a scrolling nav bar on top
  3. Start the app and scroll to reduce the nav bar and scroll to top again or push an other view controller and come back

Expected behavior The color of the scrolling nav bar should stay the same

yavl98 commented 3 years ago

Same is happening for me, have to downgrade to 5.7.0. Spent many hours trying to figure out what is causing this after swift packages update.

andreamazz commented 3 years ago

Yup, it was #399 I'm looking into a fix to keep that fix too.

andreamazz commented 3 years ago

Ok, this seems like a UIKit bug to me, updating navigationBar.standardAppearance.titleTextAttributes [NSAttributedString.Key.foregroundColor] changes the tint color for some reason. I've disabled that line for now, I'll release a new version.

andreamazz commented 3 years ago

5.7.3 is up

PGHM commented 3 years ago

I've disabled that line for now, I'll release a new version.

Any plans to reintroduce the title alpha updating at some point? iOS15 forces us to use the new way of setting navigation bar appearance and now the title alpha is not correctly set when the navigation bar is hiding. (It does work when I uncomment the lines that were commented though or if I use a custom title view)

Edit: I can of course still use 5.7.2 for now, as the tint color seems to not be a problem for me. Just thinking when iOS15 is released this might be a problem for a lot of people.

andreamazz commented 3 years ago

@PGHM Yeah, for the time being you can use 5.7.2, the only change is that one. Currently I don't have much time to work on this, hopefully I'll do a round of compatibility fixes for iOS15 before its release.