问题描述
限时送ChatGPT账号..我想为文本创建一个动画,就像在机场航班时刻表上所做的那样.从顶部下降并更改其上的文本.这是图像.所以当我点击按钮时,图像上的文字应该随着上述动画而改变.安卓可以吗?
I want to create an animation for the text like on Airport the flight schedule board does. Dropping from top and change the text on it. Here is the image. So When I click on button the text on the image should change with the said animation. Does it possible with android?
请指导我如何在android中实现这种动画?
Please guide me how can I achieve this kind of animation in android?
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/clockbg1" android:duration="150" />
<item android:drawable="@drawable/clockbg2" android:duration="150" />
<item android:drawable="@drawable/clockbg3" android:duration="150" />
<item android:drawable="@drawable/clockbg4" android:duration="150" />
<item android:drawable="@drawable/clockbg5" android:duration="150" />
<item android:drawable="@drawable/clockbg6" android:duration="150" />
</animation-list>
我的活动课:
public class XMLAnimation extends Activity {
private static AnimationDrawable animation;
private ImageView refresh;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
refresh = (ImageView) findViewById(R.id.simple_anim);
refresh.setBackgroundResource(R.drawable.loader_animation);
animation = (AnimationDrawable) refresh.getBackground();
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
animation.start();
}
现在如何在此图像上放置垂直动画文本,使其看起来像我想要创建的动画?
Now How to place vertically animated text on this images so it looks like the animation I wanted to create?
谢谢,AndroidVogue
Thanks, AndroidVogue
推荐答案
我有可用的库.最初由其他人开发,但我从 Froyo
提供了对向下版本的支持.我希望这可以帮助你.
I got working library. Originally developed by someone else but I provided support for down version from Froyo
. I hope this can help you out.
AbhanFlipView
参考:
库开发者:Emil Sjölander动画制作者:Jake Wharton
Library Developed By: Emil Sjölander Animations Created By: Jake Wharton
更新
它有一个名为 HowTo.txt
的文档显示了如何集成.
It has a document named HowTo.txt
shows how to integrate.
谢谢.
这篇关于Android 自定义动画,如机场时间表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论