2014-07-23 124 views
3

我試圖從右側的操作欄打開一個對話框。我想將動畫從右上角加載到左下角。這是我所擁有的,但是它從左上角加載到右下角。我試圖切換它無濟於事。謝謝你的幫助。使用xml從右上角到左下角的Android動畫

<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android"> 
    <scale android:fromYScale="0" android:toYScale="1.0" 
     android:fromXScale="0" android:toXScale="1.0" 
     android:duration="500"/> 
</set> 

回答

4

對不起幾個月太遲了,但最好的方法和建議的方法是

<set xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@android:anim/decelerate_interpolator"> 
    <scale 
      android:fromYScale="0" 
      android:toYScale="1.0" 
      android:startOffset="0" 
      android:duration="1200" 
      android:fromXScale="0" 
      android:toXScale="1.0" 
      android:fillAfter="true" 
      android:pivotX="100%" /> 
</set> 

正確的方式做,這是使用的其中動畫應該是未來支點

1

This將對您有所幫助。

我試過這樣的事情。

<?xml version="1.0" encoding="utf-8"?> 
<set xmlns:android="http://schemas.android.com/apk/res/android" 
    android:interpolator="@android:anim/decelerate_interpolator"> 
    <scale 
      android:fromYScale="0" 
      android:toYScale="1.0" 
      android:startOffset="0" 
      android:duration="1200" 
      android:fromXScale="0" 
      android:toXScale="1.0" 
      android:fillAfter="true" /> 
    <translate android:fromXDelta="100%" android:fromYDelta="-100%" 
       android:duration="700" /> 
</set> 
+0

非常感謝您鏈接的資源。這對我幫助很大。 – Grux

相關問題