修复技能卡没图片时闪退问题
This commit is contained in:
@@ -58,12 +58,12 @@
|
|||||||
|
|
||||||
UIImage* image = cell.imageView.image;
|
UIImage* image = cell.imageView.image;
|
||||||
if (image) {
|
if (image) {
|
||||||
CGFloat scale = image.size.width / image.size.height;
|
CGFloat scale = image.size.width / (image.size.height > 0 ? image.size.height : 1);
|
||||||
return CGSizeMake(20 * scale, height);
|
return CGSizeMake(20 * scale, height);
|
||||||
} else {
|
} else {
|
||||||
NSURL *imgUrl = [NSURL URLWithString:[self.dataArray safeObjectAtIndex1:indexPath.item]];
|
NSURL *imgUrl = [NSURL URLWithString:[self.dataArray safeObjectAtIndex1:indexPath.item]];
|
||||||
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
|
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
|
||||||
CGFloat scale = myImage.size.width / myImage.size.height;
|
CGFloat scale = myImage.size.width / (myImage.size.height > 0 ? myImage.size.height : 1) ;
|
||||||
if (scale == 0) {
|
if (scale == 0) {
|
||||||
return CGSizeMake(60, height);
|
return CGSizeMake(60, height);
|
||||||
}else {
|
}else {
|
||||||
|
Reference in New Issue
Block a user