如何在沒有事務動畫的情況下繪製圖層?例如,當我設置使用CATransaction
的層的內容它工作得很好:CGContextDrawImage without Transaction動畫
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue
forKey:kCATransactionDisableActions];
myLayer.contents = (id)[[imagesTop objectAtIndex:Number]CGImage];
[CATransaction commit];
,但我需要從委託方法[myLayer setNeedsDisplay]
改變內容。下面是代碼:
-(void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context
{
CGContextDrawImage(context, rect, Image.CGImage]);
}
你是什麼層的代表同樣的效果? – sch 2012-02-22 16:54:58