使UILabel的文字变为粗体 [英] make UILabel's text bold
本文介绍了使UILabel的文字变为粗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想让UILabel的文字变为粗体
I want to make UILabel's text bold
infoLabel=[[UILabel alloc]initWithFrame:CGRectMake(90,150, 200, 30)];
[infoLabel setText:@"Drag 14 more Flavors"];
[infoLabel setBackgroundColor:[UIColor clearColor]];
[infoLabel setFont:[UIFont fontWithName:@"Arial" size:16]];
[infoLabel setTextColor:[UIColor colorWithRed:193.0/255
green:27.0/255
blue:23.0/255
alpha:1 ]];
推荐答案
尝试
[infoLabel setFont:[UIFont fontWithName:@"Arial-BoldMT" size:16]];
您可能还需要检查您尝试使用的字体是否在设备上可用
It may also be worth checking if the font you're trying to use is available on device
这篇关于使UILabel的文字变为粗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文