繁体   English   中英

objectAnimator在Android中显示片段的白色背景

[英]objectAnimator shows white background for fragments in Android

我正在尝试实现幻灯片动画中的幻灯片片段。 动画工作正常,但它之间显示一些白色布局,该如何隐藏或删除呢?

我提到了这篇文章,但不知道要做什么Android-在同一个XML文件上进行翻译和objectAnimator

我的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>

在我的片段中这样称呼

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

任何帮助将不胜感激

经过数小时的搜索和调试...我终于找到了答案!

您需要创建自己的自定义类来扩展framelayout并应用属性:)希望对您有所帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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