我有这个代码,它真的不是标签,但我希望文本是白色的,如果可能的话是粗体。
- (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];
谢谢