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

标签 iphone ios animation uitoolbar tintcolor

我正在尝试为 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]; 

最佳答案

色调颜色不可通过公共(public) API 设置动画。您可以通过手动更改计时器上的色调来解决此问题。您将不得不插入中间颜色级别。

关于iphone - 我可以淡化/动画 UIToolbar 的 tintColor 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4495101/

相关文章:

iOS 应用提交 : invalid signature

iphone - 如何在iOS中将 slider 值转换为整数?

ios - swift 重复链式动画

ios - 取消 UIWebView loadRequest

java - 我应该为此动画使用 SwingWorker、线程或递归更新吗?

使用 ImageMagick 进行 R GIF 动画

iphone - CSS3 : Detecting device orientation for iPhone

ios - Swift 错误消息 : Initializer for conditional binding must have Optional type, 而不是 '[CLBeacon]'

ios - 在高度上更改滑动的 tableview 单元格的高度

iOS:使用 UIBlurEffect 的过渡动画?