我在我的 Android 应用程序中使用 Action Bar,我在 Activity 转换期间使用滑动动画,通过调用:
startActivityForResult(i, ALL_OK);
overridePendingTransition(R.anim.slide_in, R.anim.slide_out);
在我的 xml 文件中,我有以下代码:
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="400"/>
</set>
和
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="-100%p" android:duration="400"/>
</set>
动画执行成功,但幻灯片还包含Action Bar。
有没有办法让 Action Bar 在 Activity 转换期间保持稳定?
最佳答案
Is there a way that the Action Bar will stay stable during the activity transition ?
不,对不起。如果您在 Activity 之间切换,整个用户界面、操作栏和所有内容都会发生变化。
如果您想要的 UI 行为是必不可少的,请重写您的应用以包含一个 Activity 和多个 fragment ,并使用动画在 fragment 之间进行转换。
关于android - 在 Activity 过渡动画期间保持 Action Bar 稳定,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17014470/