Translate animation code

喜你入骨 提交于 2020-01-06 14:07:54

问题


I am a noob coming from a PHP background so kindly excuse me if this is too basic a question.

Basically, this is what I want to do: make an image animate/drop from the top of the screen to 25% down in 5 seconds

so I googled and ended up on: http://developer.android.com/reference/android/view/animation/TranslateAnimation.html

the problem is I cannot find any sample code there (like in php you can type a function, eg: php.net/explode and it shows you an example with explode(), but here for a noob like me it's extremely difficult.) is there anywhere to get the code to do the above (or a starting point to which i can modify to achieve the above)?


回答1:


Sample code is available via the SDK and AVD manager. You should download API Demos. It shows you how to do this two ways. Number 1 via XML and 2 via code. The class is called LayoutAnimation2.java. You can also view it right online via the Android Developer Website, look here.



来源:https://stackoverflow.com/questions/5293991/translate-animation-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!