给LinearLayout的子View添加动画

/** 动画控制器 */
public class MyActivity{
    private LayoutAnimationController loadLayoutAnimation;
    private LinearLayout problemAddView;
    @Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    loadLayoutAnimation = AnimationUtils.loadLayoutAnimation(MyActivity.this, R.anim.animation_controller); 
	    
	    problemView = (LinearLayout) LayoutInflater.from(this).inflate(R.layout.car_details_problem, null);
            problemAddView.setLayoutAnimation(loadLayoutAnimation);
	} 
}
animation_controller.xml布局
<?xml version="1.0" encoding="utf-8"?>
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
    android:animation="@anim/right_fade_in"
    android:animationOrder="normal"
    android:delay="30%" />
相关文章
相关标签/搜索