IOS 13 Tabbar,字体颜色修复

ios 13中使用富文本设置tabbar默认颜色异常

[obj.tabBarItem setTitleTextAttributes:@{NSFontAttributeName:[UIFont customWithName:@"PingFangSC-Regular" size:10],NSForegroundColorAttributeName:[UIColor blackColor]} forState:UIControlStateNormal];

        [obj.tabBarItem setTitleTextAttributes:@{NSFontAttributeName:[UIFont customWithName:@"PingFangSC-Regular" size:10],NSForegroundColorAttributeName:[UIColor colorWithHex:@"#2C68FF"]} forState:UIControlStateSelected];

修改:

if (@available(iOS 10.0, *)) {

        self.tabBar.unselectedItemTintColor = [UIColor blackColor];

        self.tabBar.tintColor = [UIColor colorWithHex:@"#2C68FF"];

    } else {

        // Fallback on earlier versions

    }

你可能感兴趣的:(IOS 13 Tabbar,字体颜色修复)