我是一个来自 PHP 背景的菜鸟,所以如果这是一个太基本的问题,请原谅我。
基本上,这就是我想做的:
让图像在 5 秒内从屏幕顶部动画/下降到 25%,
所以我用 google 搜索并最终得到:
http://developer.android.com/reference/android/view/animation /TranslateAnimation.html
问题是我在那里找不到任何示例代码(就像在 php 中一样,您可以键入一个函数,例如:php.net/explode ,它会向您显示一个 Explode() 的示例,但这里是一个像我这样的菜鸟,这是非常困难的。)有没有地方可以获取执行上述操作的代码(或者我可以修改以实现上述操作的起点)?
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)
示例代码可通过 SDK 和 AVD 管理器获取。您应该下载 API 演示。它向您展示了如何通过两种方式执行此操作。第 1 个通过 XML,第 2 个通过代码。该类名为 LayoutAnimation2.java。您还可以通过 Android 开发者网站在线查看它,请查看 此处。
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.