最新发布的iOS13,必须适配一波
本App上涉及有两点,一个modalPresentationStyle,也就是模态弹出页面效果,一个是输入框私有属性placeholderLabel不允许访问
1,modalPresentationStyle
iOS13中默认的弹出效果不再是UIModalPresentationFullScreen,而是新出现的UIModalPresentationAutomatic
效果图想恢复原先效果,直接设置modalPresentationStyle属性
webViewController *webvc = [[webViewController alloc] init];
webvc.modalPresentationStyle = 0;
[self presentViewController:webvc animated:YES completion:nil];
2,UITextField 的私有属性被限制
[_textField setValue:_ccolor forKeyPath:@"_placeholderLabel.textColor"];
想上面的代码肯定会报错了
修改的话,使用UITextField的attributedPlaceholder属性
NSMutableAttributedString*placeholderString = [[NSMutableAttributedString alloc] initWithString:placeholder attributes:@{NSForegroundColorAttributeName:self.placeholderColor}];
_textFD.attributedPlaceholder = placeholderString;
遇到,解决,并记录!!!
网友评论