objectAnimator shows white background for fragments in Android

こ雲淡風輕ζ 提交于 2019-12-24 12:07:54

问题


i am trying to implement slide in slide out animation for fragments. animation is working fine but it shows some white color layout in between how can i hide or remove that?

i referred to this post, but don't know exactly what has to be done Android - Making translations and objectAnimator on the same XML file

my slide-in-left.xml

<set xmlns:android="http://schemas.android.com/apk/res/android" >

<objectAnimator
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="500"
    android:propertyName="x"
    android:valueFrom="1000"
    android:valueTo="0"
    android:valueType="floatType" />

</set>

calling like this in my fragment

transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right,
                    R.anim.slide_in_right, R.anim.slide_out_left
                    );

any help will be really appreciated


回答1:


After Hours of searching and debugging...i finally found the answer!

you need to create your own custom class which extends framelayout and apply properties:) hope it helps some one!



来源:https://stackoverflow.com/questions/25339014/objectanimator-shows-white-background-for-fragments-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!