PDA

View Full Version : How do I make a UILabel in "Helvetica Bold" font? (programmatically)




stoopkitty
Apr 2, 2011, 06:48 PM
I can do this from IB, but not in code. All it does it make it What am I doing wrong?
textToConvertLabel.font = [UIFont fontWithName:@"Helvetica Bold" size:17];


Also, another thing I was wondering about is that I have to set the background color of the text to clear manually by doing
textToConvertLabel.backgroundColor = [UIColor clearColor];

If I dont change the background color it defaults to white. It seems like it should default to clear. Am I doing something wrong or is that just the way it is?



Sykte
Apr 2, 2011, 07:11 PM
I can do this from IB, but not in code. All it does it make it What am I doing wrong?
textToConvertLabel.font = [UIFont fontWithName:@"Helvetica Bold" size:17];


Also, another thing I was wondering about is that I have to set the background color of the text to clear manually by doing
textToConvertLabel.backgroundColor = [UIColor clearColor];

If I dont change the background color it defaults to white. It seems like it should default to clear. Am I doing something wrong or is that just the way it is?

@"Helvetica-Bold"