2013-02-12 70 views
1

我在我的xib文件中绘制了一个视图。我希望它在动画时改变它的颜色。动画正在工作。但我无法找到改变对象的颜色。 请帮我这个。我对ios完全陌生。 Thanx提前。在动画时更改UIView对象参考的颜色

+1

请添加一些正在发生的示例代码。 – slm 2013-02-12 04:50:31

回答

0

在您的UIView动画过程中编写以下代码。

YourView.backgroundColor = [UIColor redColor]; 
0

试试这个。

[UIView animateWithDuration:2.0 animations:^ { 

    //other animations 

    self.view.backgroundColor = [UIColor redColor]; 
} 
completion:nil]; 
0

我不认为你可以像这样的动画颜色(with animateWithDuration ...)。你将不得不使用计时器并迭代一系列颜色。您可以使用colorWithHue:saturation:brightness:alpha:例如,并增加色调值。