2009-02-22 208 views
0

我想让iPhone背景颜色每X秒改变一次颜色。闪烁的颜色

我该怎么做?

我一直在尝试UIAnimation,但只能让它变成列表中最后一种颜色。

回答

3

您可以使用自定义动画来遍历颜色数组,或者只是使用计时器。计时器将调用一个函数来设置所选的背景颜色,然后在视图上调用setNeedsDisplay。 E.E.

​​

然后设置定时器:

[NSTimer scheduledTimerWithTimeInterval:0.1f target:self selector:@selector(timerEntry) userInfo: nil repeats: NO]; 
+0

如何实现阵列和colorIndex的事情吗? – Domness 2009-02-22 20:59:46