給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%" />
相關文章
相關標籤/搜索