2016-08-01 114 views
-3

我有一個按鈕,我想要將它變換爲FAB。請參閱下面的動畫以供參考。有人可以讓我知道如何做到這一點。Android動畫 - 將按鈕變換爲FAB

enter image description here

+0

我不認爲按鈕變成了FAB。點擊它循環隱藏,並且「ProgressBar」變得可見,並且循環顯示以下屏幕。爲了實現更平滑的過渡,視圖交叉漸變。請查看以下鏈接,瞭解如何在android中使用循環顯示/隱藏功能 - http://lgvalle.xyz/2015/06/07/material-animations/ – Mithun

回答

1
<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@android:anim/linear_interpolator"> 

    <scale 
     android:duration="700" 
     android:fillBefore="false" 
     android:fromXScale="1.0" 
     android:fromYScale="1.0" 
     android:pivotX="50%p" 
     android:pivotY="50%p" 
     android:toXScale="0.0" 
     android:toYScale="1.0" /> 

</set> 

這是一個簡單的規模的動畫。