美文网首页bugs
iOS 14 UIPageControl crash

iOS 14 UIPageControl crash

作者: 介和 | 来源:发表于2020-09-25 17:18 被阅读0次

iOS 14  上 ,必现:

[self.pageControl setValue:[UIImage imageNamed:@"cccc"]   forKeyPath:@"pageImage"];

[self.pageControl setValue:[UIImage imageNamed:@"bbbbb"]    forKeyPath:@"currentPageImage"];

解决方式 如下:

   if(@available(iOS14, *) ){

       self.pageControl.currentPageIndicatorTintColor = [UIColor colorWithHexString:@"#500000"];

       self.pageControl.pageIndicatorTintColor = UIColor.whiteColor;

   }else{

      [self.pageControl setValue:[UIImage imageNamed:@"cccc"]    forKeyPath:@"pageImage"];

     [self.pageControl setValue:[UIImage imageNamed:@"bbbbb"]   forKeyPath:@"currentPageImage"];

    }

相关文章

网友评论

    本文标题:iOS 14 UIPageControl crash

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