Android 自定义动画,如机场时间表

编程入门 行业动态 更新时间:2024-10-12 10:18:34
本文介绍了Android 自定义动画,如机场时间表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-21 01:18:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/993837.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   时间表   机场   动画   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!