AnimationDrawable回到初始状态(重置)
2017-08-21 14:21
351 查看
用AnimationDrawable的时候发现只有start()和stop(),但是需要把动画重新返回初始状态的时候怎么办?
解决方法1:
解决方法2:
回到第一帧
解决方法1:
((AnimationDrawable)(someButton.getBackground())).stop(); someButton.setBackgroundDrawable(null); someButton.setBackgroundResource(R.drawable.animation);
someButton.setBackgroundDrawable(null);这句会kill掉view的背景的动画
解决方法2:
timerAnimation.stop(); timerAnimation.selectDrawable(0);
回到第一帧
相关文章推荐
- iOS 动画 UIView CoreAnimation 回到初始状态
- CABasicAnimation CAAnimationGroup等动画结束后避免回到初始状态的设置方法
- 重置CMD,恢复初始状态
- 如何让vs2012回到初始状态
- 利用 Resetter 将 Ubuntu 系发行版重置为初始状态 | Linux 中国
- 如何让vs2008回到初始状态
- animation 动画的状态重置
- windows7 64位系统重置ie浏览器让其恢复初始状态
- iOS小效果(3)按钮控制图片回到初始状态
- 如何快速重置OUTLOOK2013,2016到初始配置状态,outlook 修改数据文件位置
- Vue 重置组件到初始状态的方法示例
- Win7系统使用内置系统重置和系统刷新功能将系统恢复到初始状态
- 利用 Resetter 将 Ubuntu 系发行版重置为初始状态
- 让vs2008回到初始状态
- 利用 Resetter 将 Ubuntu 系发行版重置为初始状态
- 如何让vs2008回到初始状态
- cassandra删除所有数据,重置为初始状态——删除<data dir>/data/* <data dir>/commitlog/* <data dir>/saved_caches/* 重启cassandra即可
- 重置cmd,恢复初始状态
- 如何让vs2008回到初始状态
- MySQL5.7初始密码查看及重置