1
NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
attachment.image = [UIImage imageNamed:@"smiley_0.png"];
attachment.bounds = CGRectMake(0, 0, 22, 22);
NSMutableAttributedString *attributedString = [[NSAttributedString attributedStringWithAttachment:attachment] mutableCopy];
[aLabel setAttributedText:attributedString];
使用上面的代碼,aLabel
可以顯示圖像(smiley_0.png)正確的,現在我想追加一個字符串到aLabel
,任何想法?NSMutableAttributedString包含NSMutableAttributedString和NSString的
你試過追加嗎? – Wain
@多謝了,我試過了,但其他一些問題使它顯示錯誤,現在沒事。 – Mil0R3