UINavigationBar change Tint color with animation

后端 未结 3 2005
梦毁少年i
梦毁少年i 2021-02-04 18:13

Is it possible to change the tint with animation for a smoother effect?

This doesn\'t work for me:

[UIView beginAnimations:nil context:nil];
[self.naviga         


        
3条回答
  •  粉色の甜心
    2021-02-04 18:39

    You can't animate bar tint - the list of properties (for a UIView) that can be animated in this way is here.

    I don't think you can do that at all unless you want to overlay a bar that has a neutral tint with a UIView whose background color is changing. backgroundColor is one of the properties that can be animated. But you may have to get sneaky if you want to put a UIView on top of the navigation bar, I don't know of a way to do that.

    Another thought - subclassing and doing the drawing yourself in drawRect?

提交回复
热议问题