小编Bry*_*yce的帖子

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

我试图动画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)

iphone animation uitoolbar tintcolor ios

10
推荐指数
1
解决办法
2816
查看次数

标签 统计

animation ×1

ios ×1

iphone ×1

tintcolor ×1

uitoolbar ×1