Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] [iOS] NavigationBar resetting TextColor to black at every change of BarBackgroundColor #9767

Closed
luccasclezar opened this issue Feb 28, 2020 · 1 comment
Assignees
Labels
a/navbar i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
Milestone

Comments

@luccasclezar
Copy link

luccasclezar commented Feb 28, 2020

Description

Well, basically the PropertyChanged of BarBackgroundColor resets the NavigationBar's Appearance instead of modifying the current one. You can see this happening at this line:

var navigationBarAppearance = new UINavigationBarAppearance();

If this line is changed to:

var navigationBarAppearance = NavigationBar.StandardAppearance;

The bug is gone.

I can't provide any repro projects as I'm experiencing this issue on a commercial app and couldn't reproduce the issue on a new project, but just looking at the line I linked it's possible to understand that the code should be like I said if nothing is meant to be overwritten.

I tested this modification with the said commercial app and it's working. 🙂

Basic Information

  • Version with issue: 4.5
  • Platform Target Frameworks:
    • iOS: 13 (13.3.1)

Workaround

On a new NavigationRenderer's PropertyChanged, copy the code of UpdateBarBackgroundColor (

) and replace new UINavigationBarAppearance() to NavigationBar.StandardAppearance as I said in the description.

@luccasclezar luccasclezar added s/unverified New report that has yet to be verified t/bug 🐛 labels Feb 28, 2020
@pauldipietro pauldipietro added this to New in Triage Feb 28, 2020
@vniehues
Copy link

I have the exact same issue. I use the app resources to theme my app based on the OS theme (android 10 & iOS 13) and while everything else changes perfectly, the NavigationBar is off.
Switching the page and going back will result in the correct colors showing again.

@jsuarezruiz jsuarezruiz removed the s/unverified New report that has yet to be verified label Mar 2, 2020
@jsuarezruiz jsuarezruiz moved this from New to Needs Estimate in Triage Mar 2, 2020
@jsuarezruiz jsuarezruiz added the i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often label Mar 2, 2020
@samhouts samhouts added this to the 4.5.0 milestone Mar 3, 2020
@samhouts samhouts added this to To do in Sprint 167 Mar 3, 2020
@jsuarezruiz jsuarezruiz self-assigned this Mar 4, 2020
@jsuarezruiz jsuarezruiz moved this from To do to In progress in Sprint 167 Mar 4, 2020
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Mar 4, 2020
@samhouts samhouts added this to In Progress in v4.5.0 Mar 4, 2020
@samhouts samhouts moved this from In progress to Ready for Review (Issues) in Sprint 167 Mar 4, 2020
@samhouts samhouts removed this from Needs Estimate in Triage Mar 4, 2020
@samhouts samhouts moved this from In Progress to Done in v4.5.0 Mar 5, 2020
@samhouts samhouts moved this from Ready for Review (Issues) to Done in Sprint 167 Mar 5, 2020
samhouts pushed a commit that referenced this issue Apr 7, 2020
* Fixed NavBar BackgroundImage issue on iOS 13

* Fixed NavBar TintColor issue updating it from a CustomRenderer ViewWillAppear in iOS13

* Code refactoring

* Verify background image in iOS 13 with background changes

* Merge branch '4.5.0' into fix-9767-II

* - xcode11 check

Co-authored-by: Samantha Houts <samhouts@users.noreply.github.com>
Co-authored-by: shane <shneuvil@microsoft.com>
fixes #9767
@samhouts samhouts removed this from Done in v4.5.0 May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/navbar i/high Completely doesn't work, crashes, or is unusably slow, has no obvious workaround; occurs less often i/regression in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
No open projects
Sprint 167
  
Done
Development

No branches or pull requests

4 participants