使用LayoutTransition在View动态显示和隐藏时候加上动画
1.方法一:
在容器的xml文件中加入:
android:animateLayoutChanges="true"
2.方法二:
LayoutTransition transition = new LayoutTransition();
container.setLayoutTransition(transition);
给容器中的子view加动画:
LayoutTransition transition = container.getLayoutTransition();
transition.enableTransitionType(LayoutTransition.CHANGING);