Я использовал следующий код, чтобы добавить иконку в мой UILabelКак выровнять значок UILabel с текстом в прошивкой
UIImage *image3 = [UIImage imageNamed:@"icon_comments.png"];
UIImage *myIcon3 = [self imageWithImage:image3 scaledToSize:CGSizeMake(20, 20)];
NSTextAttachment *attachment3 = [[NSTextAttachment alloc] init];
attachment3.image = myIcon3;
NSAttributedString *attachmentString3 = [NSAttributedString attributedStringWithAttachment:attachment3];
NSString *temp3 = [NSString stringWithFormat: @"%d", test.noComments];
NSAttributedString *titleString3 = [[NSAttributedString alloc] initWithString:temp3];
NSMutableAttributedString *myString3 = [[NSMutableAttributedString alloc] initWithString:@""];
[myString3 appendAttributedString:attachmentString3];
[myString3 appendAttributedString:titleString3];
cell.noComments.attributedText = myString3;
теперь проблема, что текст не выровнен по вертикали с пиктограммой, может ли один скажите мне в чем проблема и как я могу ее решить
Большого спасибо –