标签更改

This commit is contained in:
liyuhua
2023-08-10 11:08:11 +08:00
parent cdfcfb33c7
commit c5e3f6f615
5 changed files with 13 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 817 B

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1174,19 +1174,19 @@
UIImage* image = imageView.image;
if (image) {
CGFloat scale = image.size.width / image.size.height;
imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
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, 20);
imageView.bounds = CGRectMake(0, 0, 60, 18);
}else {
imageView.bounds = CGRectMake(0, 0, 20* scale, 20);
imageView.bounds = CGRectMake(0, 0, 18* scale, 18);
}
} else {
imageView.bounds = CGRectMake(0, 0, 60, 20);
imageView.bounds = CGRectMake(0, 0, 60, 18);
}
}
imageView.contentMode = UIViewContentModeScaleAspectFit;
@@ -1218,9 +1218,9 @@
UIImage* image = imageView.image;
if (image) {
CGFloat scale = image.size.width / image.size.height;
imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
imageView.bounds = CGRectMake(0, 0, 18 * scale, 18);
} else {
imageView.bounds = CGRectMake(0, 0, 20, 20);
imageView.bounds = CGRectMake(0, 0, 18, 18);
}
imageView.layer.masksToBounds = YES;
imageView.contentMode = UIViewContentModeScaleAspectFit;
@@ -1235,7 +1235,13 @@
if (imageName == nil && imageName.length <= 0) {
return nil;
}
return [self createImageAttribute:[UIImage imageNamed:imageName]];
UIImageView *imaveView = [[UIImageView alloc]init];
imaveView.image = [UIImage imageNamed:imageName];
CGFloat scale = (CGFloat)imaveView.image.size.width / (CGFloat)imaveView.image.size.height;
imaveView.bounds = CGRectMake(0, 0, 16 * scale, 16);
NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imaveView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imaveView.frame.size.width, imaveView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
return attrString;
}
///