UILabel后添加标签(图片,UIView)

2016-08-24  本文已影响96人  陈鸿禧

statusButton.titleLabel.text = statusText;[statusButton setTitle:statusText forState:UIControlStateNormal];[statusButton sizeToFit];[attrTitle addAttribute:NSFontAttributeName value:kThinFontWithSize(FONTSIZE_LITTLE) range:NSMakeRange(0, [attrTitle length])];NSMutableAttributedString *attachText = [NSMutableAttributedString yy_attachmentStringWithContent:statusButton contentMode:UIViewContentModeCenter attachmentSize:statusButton.size alignToFont:kThinFontWithSize(FONTSIZE_LITTLE) alignment:YYTextVerticalAlignmentCenter];[attrTitle appendAttributedString:attachText];_titleLabel.attributedText = attrTitle;

上一篇 下一篇

猜你喜欢

热点阅读