I've searched the web and I can't get a good answer, although I'm sure this is very simple. Can someone please show me how to do the following: Make a UIFont of name "Helvetica-Bold", size 8.0, and color of black.
I've got the name and size, but I can't figure out how to change the color:
UIFont *textFont = [UIFont fontWithName:@"Helvetica-Bold" size:8.0];
Thanks!
UIFont does not contain/maintain any color information, so this is not possible. In general, controls that use UIFont such as a UILabel have both a font and a textColor property. So you would set a label's font and it's color like this:
myLabel.textColor = [UIColor blackColor]; myLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:8.0];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With