listview动画效果  递增式出现

来源:互联网 发布:数理经济学知乎 编辑:程序博客网 时间:2024/06/13 18:16
private LayoutAnimationController getListAnim() {
    AnimationSet set = new AnimationSet(true);
    Animation animation = new AlphaAnimation(0.0f1.0f);
    animation.setDuration(200);
    set.addAnimation(animation);

    animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF0.0f,
            Animation.RELATIVE_TO_SELF0.0fAnimation.RELATIVE_TO_SELF,
            -1.0fAnimation.RELATIVE_TO_SELF0.0f);
    animation.setDuration(200);//设置动画时间
    set.addAnimation(animation);
    LayoutAnimationController controller = new LayoutAnimationController(
            set0.5f);
    return controller;
}


mLv.setLayoutAnimation(getListAnim());
0 0
原创粉丝点击