直接在界面用底层的绘制API:
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);
NSString* text = @"Hello World";
[[UIColor redColor] setFill]; // 填满 红色的
// 在某个点按照 某种字体 绘制,ios7.0 之前的API ,微过期了
[text drawAtPoint:CGPointMake(10, 10) withFont:[UIFont italicSystemFontOfSize:30]];
// 在一个区域里面绘制字体
[text drawInRect:CGRectMake(10, 100, 300, 200) withFont:[UIFont boldSystemFontOfSize:24]];
CGContextRestoreGState(context);
}