<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/black" android:duration="200" />
<item android:drawable="@drawable/cyan" android:duration="200" />
<item android:drawable="@drawable/green" android:duration="200" />
<item android:drawable="@drawable/magenta" android:duration="200" />
<item android:drawable="@drawable/navy" android:duration="200" />
<item android:drawable="@drawable/orange" android:duration="200" />
<item android:drawable="@drawable/pink" android:duration="200" />
<item android:drawable="@drawable/white" android:duration="200" />
<item android:drawable="@drawable/yellow" android:duration="200" />
</animation-list>
imageView = (ImageView) findViewById(R.id.ImageButton01);
imageView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
AnimationDrawable animator = (AnimationDrawable) imageView.getBackground();
imageView.setImageDrawable(null);
animator.start();
}
});
/ Call this method to stop the animation
public void stopAnimation(){
AnimationDrawable animator = (AnimationDrawable) imageView.getBackground();
animator.stop();
imageView.setImageResource(R.drawable.icon);
}
分享到:
相关推荐
Android 使用animation_list 实现imageview 动画效果
我们都知道,在Android中如果想要显示一张图片,可以借助ImageView控件来完成,但是如果将一张GIF图片设置到ImageView里,它只会显示这张图片的第一帧,不会产生任何的动画效果。 那么就没有办法在Android里播放GIF...
实现ImageView非常流畅的点击效果.rar,太多无法一一验证是否可用,程序如果跑不起来需要自调,部分代码功能进行参考学习。
在Android系统中实现ImageView控件的动画效果
UITableViewCell 内各种滑动变化及动画效果
Google官方带旋转动画的自定义ImageView,绝对完爆别的代码,淡入淡出的一个效果。感兴趣的朋友可以下载看看~
大家在使用APP的时候,有的APP在点击语音搜索界面后,会出现一个小话筒,小话筒会类似雷达似得在闪烁,表示正在倾听你说话的内容(这个大家可以参照微软的必应APP),那么问题来了,这种动画效果是如何实现的呢?...
已经封装成工具类,简单实用,耦合性低,并且包含多种动画效果,可自定义。 typedef NS_ENUM(NSInteger,LZBFocusScrollViewScrollStyle) { LZBFocusScrollViewScrollStyle_Defalut, //默认普通滚动 ...
自定义圆形的ImageView,带有旋转动画效果
android:clipChildren="false"android:clipToPadding="false"都设置为false,需要在动画父布局之上,所有
设置动画效果waveDrawable.setWaveInterpolator(new AnticipateInterpolator());3. 将其设置给ImageViewImageView imageView = (ImageView) findViewById(R.id.image); imageView.setBackgroundDrawable...
本项目是一个模仿电池充电的动画效果源码,ImageView剪切动画,支持上下左右4个方向,想看演示的话可以装上bin下面的apk,点击开始动画就可以演示了,很简单的一个小动画。本项目编码GBK默认编译版本4.4.2
android端用于异步加载图片,内存缓存,文件缓存,imageview显示图片时增加淡入淡出动画。
ImageView实现照片墙效果,卡片效果,照片叠加,滑动切换照片,切换移除和下一张呈现处理很好,并且于底部view处理冲突事件
该自定义ImageView除了可以显示png图片,还可以显示gif图片的动画效果
//获取用于播放动画效果的控件(ImageView) ImageView imageView=(ImageView)findViewById(R.id.Image_View); //播放动画 imageView.startAnimation(animation); //帧动画 //获取用于显示帧动画的控件...
本项目是一个模仿电池充电的动画效果源码,ImageView剪切动画,支持上下左右4个方向,想看演示的话可以装上bin下面的apk,点击开始动画就可以演示了,很简单的一个小动画。本项目编码GBK默认编译版本4.4.2
主要介绍了Android编程实现ImageView图片抛物线动画效果的方法,实例分析了Android实现抛物线运动的算法原理与相关技巧,具有一定参考借鉴价值,需要的朋友可以参考下
实现图片的隐藏,出现,旋转,缩放