首先感謝Class Stacker誰給我的建議去與吐溫動畫 - 這真的完全符合我的需求thx! - 不幸的是,動畫不在API 2.1設備上顯示。
下面這個Tuturial設置我的補間動畫「clouds_pass.xml」這樣的 -
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:duration="80000"
android:interpolator="@android:anim/linear_interpolator"
android:fillAfter="true"
>
<translate
android:fromXDelta="155%p"
android:toXDelta="-100%p"
android:repeatCount="infinite"
/>
的活動在呼喚這樣的吐溫 -
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ImageView clouds = (ImageView)findViewById(R.id.clouds);
Animation cloudspass = AnimationUtils.loadAnimation(this,R.anim.clouds_pass);
clouds.startAnimation(cloudspass);
}
我不是defintly知道什麼可能是這個原因..但是從「clouds_pass.xml」中刪除android:duration標記並設置持續時間
cloudspass.setDuration(80000);
在加載動畫之後修復了它 - 現在它可以按照預期工作到API 2.0設備。
要在屏幕上移動一個或兩個圖像並與Android 2兼容,您可以使用[Tween Animations](http://developer.android.com/guide/topics/graphics/view-animation.html)。他們不是一流的,但應該適合你所描述的。 – 2013-04-25 14:35:55