我有一个由 - 组成的字符串
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]];
请告诉我该怎么做,这将是“Blah2:-%d%%””是博尔登吗?
提前致谢
也许这可以帮助你
单个 UILabel 中的粗体和非粗体文本? https://stackoverflow.com/q/3586871/1030951
它有适用于 iOS 6 的解决方案,对于 iOS5,您必须使用带有 NSAttributedString 的 CATextLayer
或者你可以参考http://www.cocoacontrols.com/platforms/ios/controls/ohattributedlabel http://www.cocoacontrols.com/platforms/ios/controls/ohattributedlabel
https://github.com/AliSoftware/OHAttributedLabel/ https://github.com/AliSoftware/OHAttributedLabel/
https://github.com/mattt/TTTAttributedLabel/ https://github.com/mattt/TTTAttributedLabel/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)