布局动画适用于ViewGroup

    //listview的随机特效通过布局动画使用于ViewGroup的子类
    public void showlvAnima(){
LayoutAnimationController loc = new LayoutAnimationController(AnimationUtils.loadAnimation(getActivity(), R.anim.listview_anima));
        loc.setOrder(LayoutAnimationController.ORDER_RANDOM);
        lv.setLayoutAnimation(loc);
        lv.startLayoutAnimation();
    }

anim文件夹下_anima.xml


<set xmlns:android="http://schemas.android.com/apk/res/android">
    <alpha 
        android:fromAlpha="0.5"
        android:toAlpha="1.0"
        android:duration="500"

        />
    <scale 
        android:fromXScale="0.1"
        android:fromYScale="0.1"
        android:toXScale="1.0"
        android:toYScale="1.0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:duration="500"
        />

set>

你可能感兴趣的:(android,android动画)