答案 0 :(得分:0)
检查一下:https://github.com/lgvalle/Material-Animations。它包含了很多材质过渡和动画的例子。
答案 1 :(得分: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>
&#13;
答案 2 :(得分: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);
我设法使用上面的代码获得结果。感谢。