【发布时间】:2017-07-27 03:48:21
【问题描述】:
【问题讨论】:
【问题讨论】:
看看这个:https://github.com/lgvalle/Material-Animations。它包含材质转换和动画的绝佳示例。
【讨论】:
使用这个。
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>
【讨论】:
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);
我设法使用上述代码得到结果。谢谢。
【讨论】: