iOS13适配中遇到的问题

1. presentViewController控制器不占全屏

解决办法

UINavigationViewController * loginNav=[[WENavigationVC alloc] initWithRootViewController:loginVC];
    loginNav.modalPresentationStyle =UIModalPresentationOverFullScreen;
    [self.navigationController presentViewController:loginNav animated:NO completion:^{
        
    }];
注意一定是UIModalPresentationOverFullScreen,如果不小心看错用了UIModalPresentationFullScreen 会导致按home键返回桌面后Controller自动dismiss

2.修改UITextField占位符字体颜色

原来的方法

[self setValue:color forKeyPath:@"placeholderLabel.textColor"];
[self setValue:font forKeyPath:@"placeholderLabel.font"];

现在合并为一个


self.attributedPlaceholder=[[NSAttributedString alloc] initWithString:placeHolder attributes:@{NSForegroundColorAttributeName:color,NSFontAttributeName:font}];

iOS13中用原来的方法会不起作用,也有人说会导致crash,我这边是在手机设置深色模式下不起作用

3.UITableView背景变黑

深色模式下UITableView如果没有设置背景色会变黑,需要设置

_tableview.backgroundColor=[UIColor whiteColor];

使用了融云SDK,继承了RCConversationListViewController需要在
viewDidLoad中设置

    self.conversationListTableView.backgroundColor=[UIColor whiteColor];
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容