0
我需要2個屏幕自定義動畫象下面這樣解釋:Android的 - 佈局動畫不會留在上面
Screen 1 Screen 2 ----------------------------- ------------------------------ | | | | | | | | | | | | | | | | | | | List 1 | List2 | ---------> | List 3 | List 4 | | (75% width) |(25% wid)| |(25%wid)| (75% width) | | | | | | | | | | | | | ----------------------------- ------------------------------
- 用戶對一個很長的觸摸列表1中的項目和從左到右的幻燈片。
- 包含列表1的視圖從左向右移動(直到屏幕結束)並淡入。顯示屏幕2。
我已經把每個列表中LinearLayout
和所有LinearLayout
s的包含在根LinearLayout
。檢測上List1
左向右輕掃後,我做這個
AnimationSet set = new AnimationSet(true);
Animation animation = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.75f,
Animation.RELATIVE_TO_PARENT, 0.0f, Animation.RELATIVE_TO_PARENT, 0.0f
);
animation.setDuration(500);
animation.setZAdjustment(Animation.ZORDER_TOP); // Keep the viewgroup on which this animation applies at the top.
set.addAnimation(animation);
LayoutAnimationController controller =
new LayoutAnimationController(set, 0.0f);
screenOne_layoutOne.setLayoutAnimation(controller);
screenOne_layoutOne.startLayoutAnimation();
我能得到的動畫,但不會留在上面的screenOne_layoutOne
(含List 1
佈局)。動畫低於List2
。
誰能告訴我問題在哪裏?
在此先感謝。