2012-03-20 91 views
2

我想創建兩幅圖像的動畫。我想要圖像,點擊後,它就像卡片一樣水平翻轉180度到新圖像(從前到後)。我想用佈局上的多個圖像來執行此操作。我該如何編寫這段代碼,並在需要執行時調用它?Android-在兩幅圖像之間翻轉水平動畫

回答

2
In Resource->Create anim folder->xml file with any name 



    <set xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shareInterpolator="false"> 
    <scale 
      android:fromXScale=".3" 
      android:toXScale="1.0" 
      android:fromYScale="0.3" 
      android:toYScale="1.0" 
      android:pivotX="50%" 
      android:pivotY="50%" 
      android:duration="800" /> 

     <rotate 
      android:fromDegrees="0" 
      android:toDegrees="180" 

      android:pivotX="50%" 
      android:pivotY="50%" 
      android:duration="800" /> 

</set> 

現在你可以在任何地方使用這個動畫和沒有時間以及