我正在尝试在 CGRect 的底部绘制一个 NSString。到目前为止,我已经能够将文本置于顶部居中,但我需要将其置于底部。我也尝试过 DrawAtPoint 但没有奏效。这是我目前拥有的代码: UIGraphicsBeginImageContext(img.size);
CGRect aRectangle = CGRectMake(0,0, img.size.width, img.size.height);
[img drawInRect:aRectangle];
[[UIColor whiteColor] set];
NSInteger fontSize = 25;
UIFont *font = [UIFont boldSystemFontOfSize: fontSize];
[text drawInRect:aRectangle withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:NSTextAlignmentCenter];
UIImage *theImage=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();