Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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                                          green:27.0/255                                           blue:23.0/255                                          alpha:1 ]]; 
like image 996
Ali Avatar asked Jan 05 '11 09:01

Ali


People also ask

How do you make your text bold?

Type the keyboard shortcut: CTRL+B.


Video Answer


2 Answers

If you want to retain the system font and make it bold:

[infoLabel setFont:[UIFont boldSystemFontOfSize:16]]; 
like image 67
Manny Avatar answered Sep 23 '22 16:09

Manny


Try

[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

like image 45
Vladimir Avatar answered Sep 23 '22 16:09

Vladimir