我想将UILabel的文本设为粗体

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]];

也可能值得检查您尝试使用的字体在设备上是否可用

10-08 05:31