佈局動畫適用於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

<?xml version="1.0" encoding="utf-8"?>
<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>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章