1、深夜模式
如果app不支持深夜模式,可以在info.plist添加UIUserInterfaceStyle,设置值为Light
<key>UIUserInterfaceStyle</key>
<string>Light</string>
![](https://img.haomeiwen.com/i2574109/a2ad585d58949514.png)
深夜模式:
![](https://img.haomeiwen.com/i2574109/41ac2a5fb6ae0965.jpg)
![](https://img.haomeiwen.com/i2574109/c0b7a1399e2d5537.jpg)
正常模式:
![](https://img.haomeiwen.com/i2574109/e1825605b74ca095.jpg)
![](https://img.haomeiwen.com/i2574109/2796053be06bd149.jpg)
2、模态视图转场动画风格默认为新增的卡片式动画,modalPresentationStyle的默认值为
UIModalPresentationAutomatic
如果要使用原来的全屏模态动画需要设置modalPresentationStyle的值为UIModalPresentationFullScreen
UIViewController *vc = [[UIViewController alloc] init];
vc.modalPresentationStyle = UIModalPresentationFullScreen;
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:vc];
nc.modalPresentationStyle = UIModalPresentationFullScreen;
[self presentViewController:nc animated:YES completion:nil];
3、设置UITabBarItem样式
if(@available(iOS 13.0, *))
{
[[UITabBar appearance] setTintColor:[UIColor orangeColor]];
[[UITabBar appearance] setUnselectedItemTintColor:[UIColor grayColor]];
}
else
{
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor grayColor],} forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor orangeColor]} forState:UIControlStateSelected];
}
4、启动图片展示弃用LaunchImage,只能用LaunchScreen
5、UISearchBar开放输入框属性searchTextField,可以直接获取到输入框的样式
UITextField *textfield = [searchBar valueForKey:@"searchField"];
if(@available(iOS 13.0, *))
{
textfield = searchBar.searchTextField;
}
else
{
UIImageView *backgroundView = textfield.subviews.firstObject;
}
6、正式弃用UIWebView,只能WKWebView的使用
7、弃用valueForKey
网友评论