0
我想在我的編程中使用動畫,但它在仿真器上看不到。它在動畫資源之前打開MenuActivity類。Android動畫顯示問題
這裏是代碼分區;
Animation anim = AnimationUtils.loadAnimation(this, R.anim.fade_in);
ImageView girisLogo = (ImageView)findViewById(R.id.girisLogoImageView);
anim.reset();
girisLogo.clearAnimation();
girisLogo.startAnimation(anim);
anim.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
Intent intent = new Intent(GirisActivity.this,MenuActivity.class);
startActivity(intent);
GirisActivity.this.finish();
}
public void onAnimationRepeat(Animation animation) {}
public void onAnimationEnd(Animation animation) {}
});
}
fade_in.xml:
<set xmlns:android="https://schemes.android.com/apk/res/android">
<alpha
android:fromAlpha = "0.0"
android:toAlpha="1.0"
android:interpolator="@android:anim/accelerate_interpolator"
android:duration="4000"
/>
</set>
我試圖用anim.serDuration(400);但結果不會改變。 你能幫我解決這個問題嗎?
感謝您的幫助,動畫看到。 – ugurgog