1.升级xcode12后,tableViewCell的层级关系发生变化,contentView默认被添加到cell的最顶层,现在所有的内容都必须添加到contentView中,否则内容显示或者事件点击会被contentView遮挡
2.相册权限发生了变化,如果有使用TZImagePickerController这个图片选择框架的,请一定要更新最新版本,否则显示会有问题
3.UIDatePicker,iOS14中UIDatePicker新增了一个属性preferredDatePickerStyle,设置该属性为UIDatePickerStyleWheels样式,则可正常显示老版本的日期滚动样式了
UIDatePicker *picker = [UIDatePicker new];
[picker addTarget:self action:@selector(datePickerDidSelected:) forControlEvents:UIControlEventValueChanged];
picker.datePickerMode = UIDatePickerModeDate;
picker.locale = [NSLocale localeWithLocaleIdentifier:@"zh_CN"];
if (@available(iOS 13.4, *)) {
picker.preferredDatePickerStyle = UIDatePickerStyleWheels;
} else {
// Fallback on earlier versions
}
4.iOS 14 YYAnimatedImageView不显示图片
解决方法: 新建YYAnimatedImageView的分类,实现以下方法
+ (void)load {
// 获取系统的对象方法
Method displayLayerMethod = class_getInstanceMethod(self, @selector(displayLayer:));
// 获取自己定义的对象方法
Method displayLayerNewMethod = class_getInstanceMethod(self, @selector(displayLayerNew:));
// 方法交换
method_exchangeImplementations(displayLayerMethod, displayLayerNewMethod);
}
- (void)displayLayerNew:(CALayer *)layer {
Ivar imgIvar = class_getInstanceVariable([self class], "_curFrame");
UIImage *img = object_getIvar(self, imgIvar);
if (img) {
layer.contents = (__bridge id)img.CGImage;
} else {
if (@available(iOS 14.0, *)) {
[super displayLayer:layer];
}
}
}
5.KVC 不允许访问 UIPageControl的pageImage
新增了API:preferredIndicatorImage设置image