我有一个UIView子类。我已经覆盖了drawRect如下。
- (void)drawRect:(CGRect)rect
{
CGRect fullRect = CGRectMake(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);
CGRect rectWithoutBorders = CGRectMake(rect.origin.x, rect.origin.y + ITEM_BORDER, rect.size.width, rect.size.height - (2*ITEM_BORDER));
[[UIColor whiteColor] set];
UIRectFill(fullRect);
[[UIColor blueColor] set];
UIRectFill(rectWithoutBorders);
}
现在想用淡化动画改变颜色。我该怎么做?我和CALayers玩过但没能得到所需的结果。