【问题标题】:objectAnimator shows white background for fragments in AndroidobjectAnimator 在 Android 中显示片段的白色背景
【发布时间】:2014-08-16 09:57:09
【问题描述】:

我正在尝试为片段实现滑入滑出动画。 动画工作正常,但在两者之间显示了一些白色布局 我该如何隐藏或删除它?

我参考了这篇文章,但不知道具体要做什么 Android - Making translations and objectAnimator on the same XML file

我的滑入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
                    );

任何帮助将不胜感激

【问题讨论】:

    标签: android android-fragments android-animation


    【解决方案1】:

    经过几个小时的搜索和调试……我终于找到了答案!

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-27
      • 1970-01-01
      • 1970-01-01
      • 2015-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多