ios - UINavigationController Bar color update in viewWillAppear updating after visible -
in app working on, have uitabbarcontroller
contains views each in uinavigationcontroller
.
one of views settings screen user can change color scheme of app. when so, , switch screen, every component supposed change color changed except background of uinavigationcontroller
. updates fraction of second after visible, there annoying flicker.
this simplification of viewwillappear
(which tested make sure still causes error)
- (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; uicolor *foreground = [self.settings getforegroundcolor]; uicolor *background = [self.settings getbackgroundcolor]; self.navigationcontroller.navigationbar.bartintcolor = background; self.navigationcontroller.tabbarcontroller.tabbar.bartintcolor = background; self.view.backgroundcolor = background; self.navigationcontroller.navigationbar.tintcolor = foreground; self.navigationcontroller.tabbarcontroller.tabbar.tintcolor = foreground; self.view.tintcolor = foreground; }
what stranger, have uibarbuttonitem
in uinavigationcontroller
bar go to, , it's color has updated before view visible, background behind still needs update.
things have tried:
[self.view setneedsdisplay];
[self.navigationcontroller.navigationbar setneedsdisplay];
viewwilllayoutsubviews
- doing either of
nsnotification
sent viewcontroller when user changed color setting (long before click tab bar @ offending viewcontroller).
is there way force draw off screen, or flicker won't occur? not understand why insisting on updating when visible, when put in main viewcontroller's viewwillappear
.
does know how make uinavigationcontroller's bar update before coming onscreen when uinavigationcontroller embedded in tab bar controller?
Comments
Post a Comment