2013-02-12 67 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:例如,並增加色調值。