设为首页 加入收藏

TOP

Android动画Animation之Frame实现类似电影的动画效果
2014-11-24 14:34:38 来源: 作者: 【 】 浏览:2
Tags:Android 动画 Animation Frame 实现 类似 电影 效果

Frame 动画,即顺序播放事先做好的图像,跟电影类似。


接下来的案例是点击按钮实现播放动画,点击停止实现停止动画播放!


1、效果图:




2、main.xml文件很简单:




4、最后是java代码:









An object used to create frame-by-frame animations, defined by a series of Drawable objects, which can be used as a View object's background.


The simplest way to create a frame-by-frame animation is to define the animation in an XML file, placed in the res/drawable/ folder, and set it as the background to a View object. Then, call start() to run the animation.


An AnimationDrawable defined in XML consists of a single element, and a series of nested tags. Each item defines a frame of the animation.


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Android实现图片顺时逆时旋转及拖.. 下一篇Android动画效果Animation之Tween..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: