ViewGroup添加删除View的动画--LayoutTransition

private void setupTransition(ViewGroup viewGroup){
    final LayoutTransition transition = new LayoutTransition();
    viewGroup.setLayoutTransition(transition);
    transition.setAnimator(LayoutTransition.APPEARING, transition.getAnimator(LayoutTransition.APPEARING));
    transition.setAnimator(LayoutTransition.DISAPPEARING, transition.getAnimator(LayoutTransition.DISAPPEARING));
    transition.setAnimator(LayoutTransition.CHANGE_APPEARING, transition.getAnimator(LayoutTransition.CHANGE_APPEARING));
    transition.setAnimator(LayoutTransition.CHANGE_DISAPPEARING, transition.getAnimator(LayoutTransition.CHANGE_DISAPPEARING));
}

你可能感兴趣的:(ViewGroup添加删除View的动画--LayoutTransition)