使用animationImages动画UIButton在动画完成后更改按钮状态淡出

时间:2016-09-20 08:45:45

标签: ios objective-c animation uibutton

我使用UIButton动画animationImages并成功制作动画,但动画完成后UIButton会自动淡出。我怎样才能避免淡出?

sender.imageView.animationImages =  [NSArray arrayWithObjects:
                                             [UIImage imageNamed:[NSString stringWithFormat:@"main_bird_animation_01%@",ipadVar]],
                                             [UIImage imageNamed:[NSString stringWithFormat:@"main_bird_animation_02%@",ipadVar]],
                                             [UIImage imageNamed:[NSString stringWithFormat:@"main_bird_animation_03%@",ipadVar]],
                                             nil];
        sender.imageView.animationDuration = 1.f;
        sender.imageView.animationRepeatCount = 4.f;
        [sender.imageView startAnimating];

1 个答案:

答案 0 :(得分:1)

我得到了解决方案,实际上有一个与UIButton相关联的属性Disabled Adjust Image,我只是取消选中它就可以了。

enter image description here