美文网首页
iOS14适配问题

iOS14适配问题

作者: Somnus_chh | 来源:发表于2020-09-22 10:18 被阅读0次

1、cell中的部分按钮点击无反应

    解决办法:看是否是用的self addSubview:更改为self.contentView addSubview:

2、使用SDWebImage加载图片,部分图片无法显示

    解决办法:更新到新版本5.9.1即可,

    如果不是SDWebImage,在UIImageView的方法- (void)displayLayer:(CALayer*)layer

    增加如下代码

    if([UIImageView instancesRespondToSelector:@selector(displayLayer:)]) {

        [super displayLayer:layer];

    }

3、从次级页面pop返回到顶层页面tabbar被隐藏问题

    解决办法:在UINavigationController的push方法中添加如下代码

    参考文章:https://blog.csdn.net/github_36843038/article/details/108666010

- (void)pushViewController:(UIViewController*)viewControlleranimated:(BOOL)animated{

    if (self.viewControllers.count == 1) {

        viewController.hidesBottomBarWhenPushed=YES;

    }

    [superpushViewController:viewControlleranimated:animated];

}

4、给UITextView添加一个UILabel做占位文本,设置UILabel背景色为白色,结果出现一条黑线

    解决办法:不设置UILabel的backgroundColor即可。

5、UIDatePicker展示不正常问题

    解决办法:如下,frame显示不正常需要把frame设置在下边代码之后

if(@available(iOS13.4, *)) {

    //老样式,新的可以使用UIDatePickerStyleInline

    datePicker.preferredDatePickerStyle=UIDatePickerStyleWheels;

}

相关文章

网友评论

      本文标题:iOS14适配问题

      本文链接:https://www.haomeiwen.com/subject/kplvyktx.html