Skip to content

Commit

Permalink
Fix topBar background color animation on iOS 13
Browse files Browse the repository at this point in the history
  • Loading branch information
yogevbd committed Dec 1, 2019
1 parent cc08ab3 commit 0c6e2f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 0 additions & 2 deletions lib/ios/UINavigationBar+utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

- (void)rnn_setBackgroundColor:(UIColor *)color;

- (void)rnn_setBackgroundColorTransparent;

- (void)rnn_setBackIndicatorImage:(UIImage *)image;

- (void)rnn_showBorder:(BOOL)showBorder;
Expand Down
10 changes: 8 additions & 2 deletions lib/ios/UINavigationBar+utils.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ - (void)rnn_setBackgroundColor:(UIColor *)color {

- (void)setBackgroundColor:(UIColor *)color {
if (@available(iOS 13.0, *)) {
[self configureWithDefaultBackground];
[self getNavigaitonBarStandardAppearance].backgroundColor = color;
[self getNavigaitonBarCompactAppearance].backgroundColor = color;
[self getNavigaitonBarScrollEdgeAppearance].backgroundColor = color;
Expand All @@ -41,7 +40,14 @@ - (void)setBackgroundColor:(UIColor *)color {

- (void)setBackgroundColorTransparent {
if (@available(iOS 13.0, *)) {
[self configureWithTransparentBackground];
UIColor* clearColor = [UIColor clearColor];
[self getNavigaitonBarStandardAppearance].backgroundColor = clearColor;
[self getNavigaitonBarCompactAppearance].backgroundColor = clearColor;
[self getNavigaitonBarScrollEdgeAppearance].backgroundColor = clearColor;
[self getNavigaitonBarStandardAppearance].backgroundEffect = nil;
[self getNavigaitonBarCompactAppearance].backgroundEffect = nil;
[self getNavigaitonBarScrollEdgeAppearance].backgroundEffect = nil;

} else {
if (![self viewWithTag:TOP_BAR_TRANSPARENT_TAG]){
UIView *transparentView = [[UIView alloc] initWithFrame:CGRectZero];
Expand Down

0 comments on commit 0c6e2f0

Please sign in to comment.