开发者

Android: automatic animation

开发者 https://www.devze.com 2023-02-27 04:10 出处:网络
I have a Button that needs to be slide in from the bottom automatically after the activity starts for 5 seconds. How do I do that? There shouldn\'t be any开发者_Go百科 user intervention (Should be don

I have a Button that needs to be slide in from the bottom automatically after the activity starts for 5 seconds. How do I do that? There shouldn't be any开发者_Go百科 user intervention (Should be done without click).

Thanks


You can do it using Tween animation. http://developer.android.com/guide/topics/resources/animation-resource.html#Tween

set field android:startOffset="5000" in xml with your animation for start delay


You can use a Timer to start the animation, whenever you want.

Check this: http://developer.android.com/reference/java/util/Timer.html

You will have to implement a Runnable that creates and runs or just runs the animation.

0

精彩评论

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