开发者

How to use fade in fade out to Background image in android..?

开发者 https://www.devze.com 2023-03-16 04:43 出处:网络
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..?

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消