Ali Ali - 1 year ago 84
Objective-C Question

I want to make UILabel's text bold

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
alpha:1 ]];

Please help

Answer Source


[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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download