android 简单图片动画播放的实例代码
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中RecyclerView布局代替GridView实现类似支付宝的界面
RecyclerView比GridView来得更加强大,不仅是在分割线的绘制方面,在条目的编辑上也做得同样出色,下面就来看一下Android中RecyclerView布局代替GridView实现类似支付宝的界面的实例2016-06-06
Android布局控件DrawerLayout实现完美侧滑效果
这篇文章主要为大家详细介绍了Android布局控件DrawerLayout实现完美侧滑效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2018-08-08
详解Android使用CoordinatorLayout+AppBarLayout+CollapsingToolbarL
这篇文章主要为大家详细介绍了Android使用CoordinatorLayout+AppBarLayout+CollapsingToolbarLayou实现手指滑动效果,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下2020-05-05
Android开发中Intent.Action各种常见的作用汇总
今天小编就为大家分享一篇关于Android开发中Intent.Action各种常见的作用汇总,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧2018-12-12


最新评论