ios - 使用 animationImages 为 UIButton 设置动画会在动画完成后更改按钮状态淡入淡出

标签 ios objective-c animation uibutton

我正在使用 animationImagesUIButton 制作动画并成功制作动画,但在动画完成后 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];

最佳答案

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

enter image description here

关于ios - 使用 animationImages 为 UIButton 设置动画会在动画完成后更改按钮状态淡入淡出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39589524/

相关文章:

java - 创建一个漂亮的 "LOADING..."动画

html - 使用 CSS3 动画将 div 从屏幕顶部移动到底部?

ios - 没有找到从 Main.storyboard 引用的 Storyboard

ios - 图像未根据方向变化调整大小

ios - 如何在点击 UITextField 时在 UIPickerView 中显示信息

objective-c - 如何显示文件缩略图?

objective-c - 使窗口弹出进出屏幕边缘

android - 查找正在使用的运营商信息,而不是 SIM 卡信息

objective-c - 清理App全局资源的最佳位置?

html - 使用 mix-blend-mode 在顶部居中文本的圆上动画刻度