Android 如何每秒减少和增加位图的alpha
我想每一秒钟减少和增加alpha位图,请帮助我。我想在画布上创建类似淡入淡出位图的动画 试试这个简单的方法Android 如何每秒减少和增加位图的alpha,android,Android,我想每一秒钟减少和增加alpha位图,请帮助我。我想在画布上创建类似淡入淡出位图的动画 试试这个简单的方法 public void animateImage(Context mContext,ImageView imgSplash){ try{ Animation myFadeInAnimation = AnimationUtils.loadAnimation(mContext, R.anim.fade_in); imgSpl
public void animateImage(Context mContext,ImageView imgSplash){
try{
Animation myFadeInAnimation = AnimationUtils.loadAnimation(mContext, R.anim.fade_in);
imgSplash.startAnimation(myFadeInAnimation);
}catch (Exception e){
}
}
将此fade_in.xml添加到res/anim文件夹中
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:interpolator="@android:anim/accelerate_interpolator"
android:duration="4000" android:repeatCount="0"/>
</set>
本博客向您展示了如何做到这一点,您可以看到这一点