فهرست منبع

更换tabb按钮颜色

Steven 7 ماه پیش
والد
کامیت
0a2079dab2

BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Tabbar/tab_musicSquare_selected.imageset/tab_musicSquare_selected@2x.png


BIN
KulexiuForStudent/KulexiuForStudent/Assets.xcassets/Tabbar/tab_musicSquare_selected.imageset/tab_musicSquare_selected@3x.png


+ 6 - 6
KulexiuForStudent/KulexiuForStudent/Common/Base/TabbarController/KSTabBarViewController.m

@@ -55,11 +55,11 @@
     }
     self.viewControllers = [NSArray arrayWithArray:ctrlArray];
     if (@available(iOS 13.0, *)) {
-        [[UITabBar appearance] setUnselectedItemTintColor:HexRGB(0x999999)];
-        [[UITabBar appearance] setTintColor:THEMECOLOR];
+        [[UITabBar appearance] setUnselectedItemTintColor:HexRGB(0x808492)];
+        [[UITabBar appearance] setTintColor:HexRGB(0x283240)];
     } else {
-        [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:HexRGB(0x999999),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} forState:UIControlStateNormal];
-        [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:THEMECOLOR,NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} forState:UIControlStateSelected];
+        [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:HexRGB(0x808492),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} forState:UIControlStateNormal];
+        [[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:HexRGB(0x283240),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} forState:UIControlStateSelected];
     }
     if (@available(iOS 15.0, *)) {
         // 适配Xcode 13 iOS 15tabbar透明的问题
@@ -81,8 +81,8 @@
     controller.tabBarItem.title = title;
     controller.tabBarItem.image = [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
     controller.tabBarItem.selectedImage = [[UIImage imageNamed:selectedImageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
-    [controller.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:HexRGB(0x999999),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} forState:UIControlStateNormal];
-    [controller.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:THEMECOLOR,NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} forState:UIControlStateSelected];
+    [controller.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:HexRGB(0x808492),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} forState:UIControlStateNormal];
+    [controller.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:HexRGB(0x283240),NSFontAttributeName:[UIFont systemFontOfSize:10 weight:UIFontWeightMedium]} forState:UIControlStateSelected];
     CustomNavViewController *navCtrl= [[CustomNavViewController alloc] initWithRootViewController:controller];
     return navCtrl;
 }