iOS 13适配
2019-10-29 本文已影响0人
money_ac9e
1.解决 TabBar 选中文字颜色为蓝色问题
只需要设置 UITabBarItem 的未选中颜色即可
if (@available(iOS 13.0, *)) {
[[UITabBar appearance] setUnselectedItemTintColor:[UIColor whiteColor]];
}
https://www.jianshu.com/p/aa098a06c868
2.解决不再允许通过 KVC 的方式去访问私有属性
[_searchController.searchBar setValue:@"取消" forKey:@"cancelButtonText"] 去掉
[_searchController.searchBar setValue:@"取消" forKey:@"cancelButtonText"]
原理:https://www.jianshu.com/p/fefef4ecd763
3. UISegmentedControl
默认样式变为白底黑字,如果设置修改过颜色的话,页面需要修改。
image原本设置选中颜色的 tintColor 已经失效,新增了 selectedSegmentTintColor 属性用以修改选中的颜色。
改变文字
NSDictionary *selecteddic = [NSDictionary dictionaryWithObjectsAndKeys:D_NavBarTintColor,NSForegroundColorAttributeName,nil];
[_segmentControl setTitleTextAttributes:selecteddic forState:UIControlStateSelected];
NSDictionary *dics = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil];
[_segmentControl setTitleTextAttributes:dics forState:UIControlStateNormal];
https://www.jianshu.com/p/8183d086b931
4.present模式选择
controller.modalPresentationStyle = UIModalPresentationFullScreen;