Animating Layout Changes(展开收起)

原文地址:https://developer.android.com/training/animation/layout.html#add

 

(1)设置布局文件:

<LinearLayout android:id="@+id/container"
    android:animateLayoutChanges="true"
    ...
/>

 

(2)Java代码

private ViewGroup mContainerView;
...
private void addItem() {
    View newView;
    ...
    mContainerView.addView(newView, 0);
}

 

 

posted @ 2013-08-05 17:41  Binary-Stream  阅读(332)  评论(0编辑  收藏  举报