为什么片段退出动画不起作用?
我从底部到顶部添加带有动画的片段,然后当按下回调或调用popBackStack()时,它应该从上到下。
val confirmFragment = ConfirmFragment.Companion.newInstance(item) val transaction = MainActivity.getMainActivity(context)!!.supportFragmentManager.beginTransaction() transaction.addToBackStack(tag) transaction.setCustomAnimations(R.anim.slide_in_bottom, R.anim.slide_out_top) transaction.replace(R.id.over_view, confirmFragment, tag) transaction.commit()
ExitAnimation(xml)
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="700" android:fromYDelta="100%" android:toYDelta="0%" > </translate> </set>
EnterAnimation(xml)
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <translate android:duration="1700" android:fromYDelta="0%" android:toYDelta="100%" > </translate> </set>
输入动画工作,但是当片段存在,它不起作用
删除你的xml代码中的set
标签。
改变这一点。
<?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="700" android:fromYDelta="100%p" android:toYDelta="0%p"> </translate>
和
<?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1700" android:fromYDelta="0%p" android:toYDelta="-100%p"> </translate>
- IOException:AsyncTask图像下载Kotlin Android(坏文件描述符)
- 在Android Databinding中绑定ObservableList的大小
- 如何改变Android中EditText的焦点颜色
- Kotlin中generics类的用法
- Android RxJava / Kotlin – 将大量数据映射到网络呼叫
- Android graphview和viewpager冲突
- 哪里可以节省Android的GPS(经度,纬度)点?
- 如何在Android应用程序中的活动之间传递数据?
- sharedpreferences上的nullPointerException helper类运行测试时