我有一个由 - 组成的字符串 -
lblWithText.backgroundColor = [UIColor clearColor];
lblWithText.textColor = [UIColor blackColor];
lblWithText.font = [UIFont fontWithName:@"Helvetica" size:12.0];
lblWithText.text = [NSString stringWithFormat:@"Blah1:blah-blah%d. Blah2:-%d%%", [currentCoupon.couponPrice intValue],[currentCoupon.couponDiscountPercent intValue]];
Run Code Online (Sandbox Code Playgroud)
请告诉我怎么做"Blah2: - %d %%""是Bolden?先谢谢你
可能这可以帮到你
它有适用于iOS 6和iOS5的解决方案,你必须使用带有NSAttributedString的CATextLayer
或者您可以参考http://www.cocoacontrols.com/platforms/ios/controls/ohattributedlabel
https://github.com/AliSoftware/OHAttributedLabel/
https://github.com/mattt/TTTAttributedLabel/