手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >android 简单图片动画播放的实例代码
android 简单图片动画播放的实例代码
摘要:xml中:复制代码代码如下:java中:复制代码代码如下:mTouchView=(ImageView)findViewById(R.id.t...

xml中:

复制代码 代码如下:

<ImageView

android:id="@+id/touchview"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentLeft="true"

android:layout_centerVertical="true"

android:src="@drawable/touch" />

java中:

复制代码 代码如下:

mTouchView = (ImageView) findViewById(R.id.touchview);

AlphaAnimation mAlphaAnimation = new AlphaAnimation(0.1f, 1.0f); ////创建一个AlphaAnimation对象,参数从透明到不透明

mAlphaAnimation.setDuration(1000);// 设定动画时间

mAlphaAnimation.setRepeatCount(Animation.INFINITE);//定义动画重复时间

mAlphaAnimation.setRepeatMode(Animation.REVERSE);//通过设置重复时间定义动画的行为

mTouchView.setAnimation(mAlphaAnimation);

mAlphaAnimation.start();

【android 简单图片动画播放的实例代码】相关文章:

android 照相功能的简单实例

android 类似微信的摇一摇功能实现思路及代码

android 实现圆角图片解决方案

Android中发送Http请求(包括文件上传、servlet接收)的实例代码

Android编程实现图标拖动效果的方法

Android 平台实现Gif 图像解码并播放代码及组件

Android 图片特效处理的方法实例

android imageview图片居中技巧应用

android中的按两次返回键退出代码

android GridView多选效果的实例代码

精品推荐
分类导航