【发布时间】:2012-02-17 15:29:19
【问题描述】:
我正在尝试绘制 CALayer 子类。
drawInContext 用 setNeedsDisplay 调用,但没有绘制任何内容。
这里在做什么/出了什么问题?
- (void)drawInContext:(CGContextRef)ctx
{
CGContextSetFillColorWithColor(ctx, [UIColor redColor].CGColor);
[[UIBezierPath bezierPathWithRect:CGRectMake(100, 100, 100, 100)] fill];
[@"Vowel" drawAtPoint:CGPointMake(0, 0) withFont:[UIFont fontWithName:@"Chalkboard" size:14]];
}
编辑 我收到此错误:
CGContextAddPath: 无效上下文 0x0
谢谢 沙尼
【问题讨论】: