我一直在尝试使用 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);
}