【发布时间】:2010-10-27 19:06:19
【问题描述】:
在一些代码中sn-p
- (void) drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx {
CGContextSetFillColorWithColor(ctx, [[UIColor darkTextColor] CGColor]);
UIGraphicsPushContext(ctx);
...
设置当前填充颜色,然后将状态推送到堆栈。 其他sn-p:
- (void) drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx {
UIGraphicsPushContext(ctx);
[[UIColor darkTextColor] set];
...
哪种方式是正确的?这两种方法CGContextSetFillColorWithColor 和UIColor set 在状态管理方面有什么区别?
【问题讨论】:
标签: iphone core-graphics