问题
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