0
A
回答
0
Animation anim1 = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.slide_from_left);
anim1.setDuration(1000); // set how long you want the animation
Animation anim2 = AnimationUtils.loadAnimation(getApplicationContext(),R.anim.slide_to_right);
anim2.setDuration(1000); // set how long you want the animation
firstlayout.setAnimation(anim1);
secondlayout.setAnimation(anim2);
secondlayout.setVisibility(View.Invisible);
我設法得到使用上面的代碼的結果。謝謝。
0
看看這個:https://github.com/lgvalle/Material-Animations。它包含了很多關於材質轉換和動畫的例子。
0
使用這個。
this.overridePendingTransition(R.anim.animation_enter,
R.anim.animation_leave)
//
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate android:fromXDelta="-100%" android:toXDelta="0%"
android:fromYDelta="0%" android:toYDelta="0%"
android:duration="700"/>
</set>
+0
如果我想只在佈局過渡?因爲看起來像這個解決方案用於啓動新的Intent時製作動畫。 –
+0
你可以使用動畫這個鏈接http://www.androidhive.info/2013/06/android-working-with-xml-animations/ –
+0
它的大概念 –
相關問題
- 1. Drupal Foundation頂杆開關不起作用
- 2. 重複機器人動畫
- 3. 機器人:ViewFlipper動畫
- 4. 機器人旋轉動畫
- 5. 機器人動畫的setBackground
- 6. 開關前,在機器人
- 7. 動畫與子畫面的2D機器人
- 8. 打開GLES或畫布? (機器人)
- 9. 開關2浮動Div與jquery動畫
- 10. 小機器人動畫延遲問題
- 11. 機器人動畫()withEndAction()VS setListener()onAnimationEnd()
- 12. 機器人連續補間動畫
- 13. 機器人 - 在值幀動畫/ arrays.xml
- 14. 機器人消失噗動畫
- 15. 機器人旋轉的動畫質量
- 16. iOS動畫開機畫面
- 17. 與機器人
- 18. 動畫與JComponents頂部
- 19. CSS動畫揮杆效果
- 20. 動畫規模:按鈕相繼與在機器人
- 21. 開發一個機器人爲與Java
- 22. Android ImageView開關資源與動畫
- 23. 機器人 - 從畫廊
- 24. 機器人與MSACCESS
- 25. Zurb的基礎3.2.5頂杆和切換頂杆
- 26. 如何開發與微軟機器人SDK和LUIS聊天機器人conected
- 27. 啓動機器人中的一個新活動,而動畫
- 28. Tablelayout與滾動型機器人
- 29. 測試動態android UI與機器人
- 30. 機器人:TextView的:頂部和底部
感謝您的回覆。有沒有使用第三方的解決方案? –
https://developer.android.com/training/material/animations.html – Remario