
cell.lblOne.text = [Nsstring stringWithFormat: @"FontSize15:: %@,FontSize20:: %@",monkey,goat];
编辑:我看到了一些关于NSAttributedString但我无法让它工作的东西.
解决方法 看看我的回答:UITextView Alternative
>制作一个NSMutableAttributedString
>给它一些属性(应用于字符范围)
>设置标签的attributedText属性
.
NSMutableAttributedString *attString = [[NSMutableAttributedString alloc] initWithString: @"monkey goat"];[attString addAttribute: NSForegroundcolorAttributename value: [UIcolor redcolor] range: NSMakeRange(0,6)];[attString addAttribute: NSFontAttributename value: [UIFont FontWithname:@"Helvetica" size:15] range: NSMakeRange(0,6)];[attString addAttribute: NSFontAttributename value: [UIFont FontWithname:@"DIDot" size:24] range: NSMakeRange(7,4)];self.label.attributedText = attString;总结
以上是内存溢出为你收集整理的ios – 同一标签中的字体大小不同?全部内容,希望文章能够帮你解决ios – 同一标签中的字体大小不同?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)