<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android" >    <translate        android:duration="800"        android:fromYDelta="-100%"        android:toYDelta="0" />    <translate        android:duration="800"        android:fromYDelta="0"        android:startOffset="1800"        android:toYDelta="-100%" /></set>

参数: startOffset表示,该动画延迟多长时间开始播放。 这样就能变现满足动画顺序播放的效果。

    public void popInfo() {        Animation anim = AnimationUtils.loadAnimation(mContext, R.anim.custom_home_text_info);       textInfo.setVisibility(View.VISIBLE); //在播放动画之前, 要让该控件先显示出来, 否则有bug。        anim.setAnimationListener(new AnimationListener() {            @Override            public void onAnimationStart(Animation animation) {            }                        @Override            public void onAnimationRepeat(Animation animation) {                            }                        @Override            public void onAnimationEnd(Animation animation) {                textInfo.setVisibility(View.GONE);            }        });        textInfo.startAnimation(anim);    }

更多相关文章

  1. Android显示GIF动画完整示例(二)
  2. 控件布局_TableLayout
  3. Android 日历方式显示的日期选择组件(日历控件之一)
  4. 控件的圆角
  5. Android 用属性动画自定义view的渐变背景
  6. android获取控件宽度
  7. Android 自定义控件之ViewPager Indicator实现方式
  8. android 属性动画之 ObjectAnimator

随机推荐

  1. Android中发送Http请求实例
  2. Android-编辑需求demo实现
  3. [转]android 系统权限大全的简介与内容
  4. #Android设计模式学习笔记(抽象工厂模式)
  5. 浅谈Android四大组件之ContentProvider
  6. Android(安卓)不规则封闭区域填充 手指秒
  7. Android(安卓)2D游戏引擎AndEngine配置环
  8. Android(安卓)TV HDMI开发
  9. Android实现拍照及图片显示效果
  10. 安卓广播的静态注册和动态注册