公屏卡顿问题

This commit is contained in:
liyuhua
2023-10-26 16:50:26 +08:00
parent cab4294e86
commit c99500e493

View File

@@ -1202,18 +1202,19 @@
CGFloat scale = image.size.width / image.size.height;
imageView.bounds = CGRectMake(0, 0, 18 * scale, 18);
} else {
NSURL *imgUrl = [NSURL URLWithString:imageName];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
if (myImage) {
CGFloat scale = myImage.size.width / myImage.size.height;
if (scale == 0) {
imageView.bounds = CGRectMake(0, 0, 60, 18);
}else {
imageView.bounds = CGRectMake(0, 0, 18* scale, 18);
}
} else {
// NSURL *imgUrl = [NSURL URLWithString:imageName];
//
// UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
// if (myImage) {
// CGFloat scale = myImage.size.width / myImage.size.height;
// if (scale == 0) {
// imageView.bounds = CGRectMake(0, 0, 60, 18);
// }else {
// imageView.bounds = CGRectMake(0, 0, 18* scale, 18);
// }
// } else {
imageView.bounds = CGRectMake(0, 0, 60, 18);
}
// }
}
imageView.contentMode = UIViewContentModeScaleAspectFit;
//