【发布时间】:2008-09-27 08:10:34
【问题描述】:
我一直在尝试使用 Quartz 上下文显示文本,但无论我尝试了什么,我都没有运气让文本显示(虽然我能够显示各种其他 Quartz 对象)。有人知道我可能做错了什么吗?
示例:
-(void)drawRect:(CGRect)rect
{
// Drawing code
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSelectFont(context, "Arial", 24, kCGEncodingFontSpecific);
CGContextSetTextPosition(context,80,80);
CGContextShowText(context, "hello", 6);
//not even this works
CGContextShowTextAtPoint(context, 1,1, "hello", 6);
}
【问题讨论】:
标签: iphone cocoa-touch quartz-2d