|
@@ -1,6 +1,5 @@
|
1
|
1
|
#import "UINavigationBar+utils.h"
|
2
|
2
|
|
3
|
|
-const NSInteger TOP_BAR_TRANSPARENT_TAG = 78264803;
|
4
|
3
|
|
5
|
4
|
@implementation UINavigationBar (utils)
|
6
|
5
|
|
|
@@ -34,7 +33,7 @@ const NSInteger TOP_BAR_TRANSPARENT_TAG = 78264803;
|
34
|
33
|
[self getNavigaitonBarScrollEdgeAppearance].backgroundColor = color;
|
35
|
34
|
} else {
|
36
|
35
|
[super setBackgroundColor:color];
|
37
|
|
- [self removeTransparentView];
|
|
36
|
+ self.barTintColor = color;
|
38
|
37
|
}
|
39
|
38
|
}
|
40
|
39
|
|
|
@@ -49,13 +48,6 @@ const NSInteger TOP_BAR_TRANSPARENT_TAG = 78264803;
|
49
|
48
|
[self getNavigaitonBarScrollEdgeAppearance].backgroundEffect = nil;
|
50
|
49
|
|
51
|
50
|
} else {
|
52
|
|
- if (![self viewWithTag:TOP_BAR_TRANSPARENT_TAG]){
|
53
|
|
- UIView *transparentView = [[UIView alloc] initWithFrame:CGRectZero];
|
54
|
|
- transparentView.backgroundColor = [UIColor clearColor];
|
55
|
|
- transparentView.tag = TOP_BAR_TRANSPARENT_TAG;
|
56
|
|
- [self insertSubview:transparentView atIndex:0];
|
57
|
|
- }
|
58
|
|
-
|
59
|
51
|
[self setBackgroundColor:[UIColor clearColor]];
|
60
|
52
|
self.shadowImage = [UIImage new];
|
61
|
53
|
[self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
|
|
@@ -73,13 +65,6 @@ const NSInteger TOP_BAR_TRANSPARENT_TAG = 78264803;
|
73
|
65
|
}
|
74
|
66
|
}
|
75
|
67
|
|
76
|
|
-- (void)removeTransparentView {
|
77
|
|
- UIView *transparentView = [self viewWithTag:TOP_BAR_TRANSPARENT_TAG];
|
78
|
|
- if (transparentView){
|
79
|
|
- [transparentView removeFromSuperview];
|
80
|
|
- }
|
81
|
|
-}
|
82
|
|
-
|
83
|
68
|
- (void)configureWithTransparentBackground {
|
84
|
69
|
if (@available(iOS 13.0, *)) {
|
85
|
70
|
[[self getNavigaitonBarStandardAppearance] configureWithTransparentBackground];
|