我正在尝试为 UIToolbar 的 tintColor 属性设置动画,以将其从一种 tintColor 更改为另一种。
这是我正在尝试的代码。不幸的是,这种变化会立即发生,并且不会从绿色变为蓝色。这很奇怪,因为我知道 Apple 在网络共享或通话时会褪色和“脉冲”工具栏颜色。那么为什么这不起作用呢?
// 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];