objectAnimator在Android中显示片段的白色背景 [英] 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?
我提到了这篇文章,但不知道确切要做什么 Android-在同一个XML文件上进行翻译和objectAnimator
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
我的slide-in-left.xml
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>
在我的片段中这样称呼
transaction.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_right,
R.anim.slide_in_right, R.anim.slide_out_left
);
任何帮助将不胜感激
推荐答案
经过数小时的搜索和调试,我终于找到了答案!
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!
这篇关于objectAnimator在Android中显示片段的白色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!