iOS13适配

1. UITextField 的私有属性 _placeholderLabel _placeholderolor 被禁止访问了

历史代码

[_textField setValue:self.placeholderColor forKeyPath:@"_placeholderLabel.textColor"];

错误信息

'Access to UITextField's _placeholderLabel ivar is prohibited. This is an application bug' 

修改UITextField的attributedPlaceholder的属性,我们可以自定义这个富文本来达到我们需要的结果。

    NSMutableAttributedString *placeholderString = [[NSMutableAttributedString alloc] initWithString:@"请输入需要搜索的内容" attributes:@{NSForegroundColorAttributeName : [UIColor hd99Color], NSFontAttributeName:[UIFont boldSystemFontOfSize:10]}];
    _seachTF.attributedPlaceholder = placeholderString;
2. 控制器的 modalPresentationStyle 默认值变了

想要找回原来默认交互设置如下

self.modalPresentationStyle = UIModalPresentationOverFullScreen;
3. 即将废弃的 LaunchImage

从 iOS 8 的时候,苹果就引入了 LaunchScreen,我们可以设置 LaunchScreen来作为启动页。当然,现在你还可以使用LaunchImage来设置启动图。不过使用LaunchImage的话,要求我们必须提供各种屏幕尺寸的启动图,来适配各种设备,随着苹果设备尺寸越来越多,这种方式显然不够 Flexible。而使用 LaunchScreen的话,情况会变的很简单, LaunchScreen是支持AutoLayout+SizeClass的,所以适配各种屏幕都不在话下。
⚠️ 从2020年4月开始,所有使⽤ iOS13 SDK的 App将必须提供 LaunchScreen,LaunchImage即将退出历史舞台。

4. 还有其他部分
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值