简体   繁体   中英

objectAnimator shows white background for fragments in Android

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM