我正在尝试在我的CPView中绘制一些文本,我有这个:
- (void)drawRect:(CGRect)aRect{
var ctx = [[CPGraphicsContext currentContext] graphicsPort],
viewBounds = [self bounds];
CGContextTranslateCTM(ctx, 0, viewBounds.size.height);
CGContextScaleCTM(ctx, 1, -1);
CGContextSetLineWidth(ctx, 2.0);
CGContextShowTextAtPoint(ctx, 100.0, 100.0, "SOME TEXT", 9);
}但是,我在控制台中得到了这个错误: ReferenceError: Can't find variable: CGContextShowTextAtPoint
我该怎么做呢?
发布于 2012-01-18 22:20:09
CGContextShowTextAtPoint是CoreText的一部分,在Cappuccino的主分支中尚未提供。您可以看看实验性的coretext分支。
现在,在master中,需要使用常规的CPTextField标签来绘制文本。
https://stackoverflow.com/questions/8911097
复制相似问题