Reputation: 41
I have this code, it really isn't a label, but I want the text to be white and if possible bold.
- (UIImage *)addText:(NSString *)text toImage:(UIImage *)image {
UIGraphicsBeginImageContext(image.size);
[image drawAtPoint:CGPointZero];
UIFont *font = [UIFont systemFontOfSize:image.size.width / 24];
CGSize expectedSize = [text sizeWithFont:font];
[text drawAtPoint:CGPointMake(image.size.width / 2 - (expectedSize.width / 2), image.size.height * 0.82) withFont:font];
Thanks
Upvotes: 1
Views: 837
Reputation: 21221
to change color youse
[[UIColor whiteColor] set];
to change font
[UIFont boldSystemFontOfSize:12]
Upvotes: 2
Reputation: 1271
you can use the fontWithName: andSize: methode
Example
[UIFont fontWithName:@"ArialMT-Bold" size:12.0];
Upvotes: 0