Quellcode durchsuchen

fixes badgeColor in ios 13+ (#6246)

The badge colour was not changing from the default red in the tab bar item (when passing "badgeColor" to "bottomTab" options)
David Adams vor 4 Jahren
Ursprung
Commit
28928e567e
Es ist kein Benutzerkonto mit dieser Commiter-Email verbunden
1 geänderte Dateien mit 6 neuen und 3 gelöschten Zeilen
  1. 6
    3
      lib/ios/UIViewController+RNNOptions.m

+ 6
- 3
lib/ios/UIViewController+RNNOptions.m Datei anzeigen

@@ -95,9 +95,12 @@ const NSInteger BLUR_STATUS_TAG = 78264801;
95 95
 }
96 96
 
97 97
 - (void)setTabBarItemBadgeColor:(UIColor *)badgeColor {
98
-	if (@available(iOS 10.0, *)) {
99
-		self.tabBarItem.badgeColor = badgeColor;
100
-	}
98
+	if (@available(iOS 13.0, *)) {
99
+        self.tabBarItem.standardAppearance.stackedLayoutAppearance.normal.badgeBackgroundColor = badgeColor;
100
+    }
101
+    else if (@available(iOS 10.0, *)) {
102
+        self.tabBarItem.badgeColor = badgeColor;
103
+    }
101 104
 }
102 105
 
103 106
 - (void)setStatusBarStyle:(NSString *)style animated:(BOOL)animated {