android中3种实现动画效果的方法
2013-12-14 20:37
513 查看
3中实现动画的方法:
ImageView imgView = (ImageView)findViewById(R.id.imageView_logo);
//第一种动画方法,使用AlphaAnimation实现动画(图片由暗变亮的过程)
//animation = new AlphaAnimation(0.0f, 1.0f);
//第二种动画方法,使用ScaleAnimation实现,动画由小变大
animation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
//下面是第三种方法,但是后面的两个参数不理解(随便赋值的),不过也能够实现
//animation = new RotateAnimation(TRIM_MEMORY_COMPLETE, BIND_ABOVE_CLIENT);
animation.setDuration(1000); //动画开始到结束过程的持续时间
animation.setAnimationListener(animationListener);//设置动画的监听
imgView.startAnimation(animation);
ImageView imgView = (ImageView)findViewById(R.id.imageView_logo);
//第一种动画方法,使用AlphaAnimation实现动画(图片由暗变亮的过程)
//animation = new AlphaAnimation(0.0f, 1.0f);
//第二种动画方法,使用ScaleAnimation实现,动画由小变大
animation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f,
Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
0.5f);
//下面是第三种方法,但是后面的两个参数不理解(随便赋值的),不过也能够实现
//animation = new RotateAnimation(TRIM_MEMORY_COMPLETE, BIND_ABOVE_CLIENT);
animation.setDuration(1000); //动画开始到结束过程的持续时间
animation.setAnimationListener(animationListener);//设置动画的监听
imgView.startAnimation(animation);
相关文章推荐
- Android中实现毛玻璃效果的3种方法
- Android中RecyclerView的item运用覆盖view的方法实现item的动画效果
- Android编程之界面跳动提示动画效果实现方法
- Android 图片平铺效果实现的3种方法
- Android控件的动画效果的实现及其AnimationListener和Interpolator的使用方法
- Android实现定制返回按钮动画效果的方法
- Android 实现圆圈扩散水波动画效果两种方法
- Android编程实现仿心跳动画效果的方法
- Android编程实现ViewPager多页面滑动切换及动画效果的方法
- Android控件的动画效果的实现及其AnimationListener和Interpolator的使用方法
- iPhone的动画效果类型及实现方法
- Android中定时器的3种实现方法
- android 布局实现旋转动画效果
- Android开发之ViewPager实现多页面切换及动画效果(仿Android的Launcher效果)
- android 实现类似于按home键效果直接返回桌面几种方法
- Android编程实现RotateAnimation设置中心点旋转动画效果
- Android实现音频条形图效果(仿音频动画无监听音频输入)
- Android动画效果Animation之Tween实现简单动画
- android一个布局由消失变为可见时实现动画效果
- Android记录2--制作表格样式+由下往上动画弹出效果实现