I want to know how to give fade in fade out animation to android:background image. i want to use two or more images and give this animation. pls . how can I do that. in any 开发者_运维百科layout..?
cheers
You have to set animation to the layout
You can provide fade_in or fad_out animation to the layout
to set fade_in to layout use the following code
Animation mAnim = AnimationUtils.loadAnimation(this, android.R.anim.fade_in);
layout.startAnimation(mAnim);
to set fade_out to layout use the following code
Animation mAnim = AnimationUtils.loadAnimation(this, android.R.anim.fade_out);
layout.startAnimation(mAnim);
精彩评论