簡體   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