手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >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双击退出Activity的类代码

在Android中动态添加Panel框架的实现代码

Android里实现退出主程序的提示代码

android panellistview 圆角实现代码

android 实现圆角图片解决方案

android操作SQLite增删改减实现代码

android书架效果实现原理与代码

Android 四种动画效果的调用实现代码

Android 网络图片查看显示的实现方法

精品推荐
分类导航