我可以淡化/动画UIToolbar的tintColor吗?

Bry*_*yce 10 iphone animation uitoolbar tintcolor ios

我试图动画UIToolbar的tintColor属性,将其从一个tintColor更改为另一个.

这是我正在尝试的代码.不幸的是,变化立即发生,并且不会从绿色变为蓝色.这很奇怪,因为我知道苹果在连接或打电话时会消失和"脉冲"工具栏色彩.那么为什么这不起作用呢?

// set initial tint color  
myBottomToolBar.tintColor = [UIColor colorWithRed:0.15 green:0.95 blue:0.15 alpha:0.6];

//animation stuff  
[UIView beginAnimations:nil context:nil];  
[UIView setAnimationDuration:1.95];  
[UIView setAnimationDelegate:self];        

//thing to animate  
myBottomToolBar.tintColor = [UIColor colorWithRed:0.15 green:0.35 blue:0.45 alpha:0.6];

//animation stuff  
[UIView commitAnimations]; 
Run Code Online (Sandbox Code Playgroud)

log*_*ell 4

色调颜色无法通过公共 API 设置动画。您可以通过手动更改计时器上的色调颜色来解决此问题。您必须插入中间颜色级别。