iOS 14 UIPageControl crash
2020-09-25 本文已影响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"];
}