IOS13 适配

2019-10-24  本文已影响0人  流星阁

1.UITabbar 标题颜色变成系统蓝色

if(@available(iOS13.0, *)) {

        // iOS 13以上

        self.tabBar.tintColor=KHexColor(@"313235");

        self.tabBar.unselectedItemTintColor = KHexColor(@"CCD0D3");

        UITabBarItem *item = [UITabBarItem appearance];

//        item.titlePositionAdjustment = UIOffsetMake(0, -2);

        [itemsetTitleTextAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"PingFangSC-Regular" size:10]} forState:UIControlStateNormal];

        [itemsetTitleTextAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"PingFangSC-Regular" size:10]} forState:UIControlStateSelected];

    }else{

        [[UITabBarItem appearance]setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor hexColorWithString:@"CCD0D3"],NSFontAttributeName:[UIFont fontWithName:@"PingFangSC-Regular" size:10]} forState:UIControlStateNormal];

        [[UITabBarItem appearance]setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor hexColorWithString:@"313235"],NSFontAttributeName:[UIFont fontWithName:@"PingFangSC-Regular" size:10]} forState:UIControlStateSelected];

    }

2.present 不全屏

带导航跳转的  navigation.modalPresentationStyle = UIModalPresentationFullScreen;

不带导航跳转 vc.modalPresentationStyle = 0;

3.禁用暗黑模式

info.plist 中添加 User Interface Style   设置为Light

4.各个版本xcode下载

https://developer.apple.com/download/more/

上一篇 下一篇

猜你喜欢

热点阅读