7

空港のフライト スケジュール ボードのように、テキストのアニメーションを作成したいと考えています。上からドロップして、その上のテキストを変更します。これが画像です。そのため、ボタンをクリックすると、画像のテキストが上記のアニメーションで変化するはずです。アンドロイドで可能ですか?

ここに画像の説明を入力

Androidでこの種のアニメーションを実現するにはどうすればよいですか?

編集:

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/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();
}

ここに画像の説明を入力 ここに画像の説明を入力 ここに画像の説明を入力 ここに画像の説明を入力 ここに画像の説明を入力 ここに画像の説明を入力

この画像に垂直にアニメーション化されたテキストを配置して、作成したいアニメーションのように見せるにはどうすればよいですか?

ありがとう、AndroidVogue

4

2 に答える 2

1

それはまさにあなたが望むものではありませんが、Kevin Dion による素晴らしい 3 部構成のチュートリアルがあり、ここから開始して、あなたが望むものに似たカスタム オドメーター ウィジェットを作成できます。始めるのに役立つはずです。

文字の上半分が下に落ちる効果を得るには (それが必要な場合)、文字をバッファー イメージに描画し、文字の垂直方向の範囲をスケーリングして短縮効果を得ることができます。

于 2011-09-08T06:59:09.847 に答える
0

私は作業中のライブラリを手に入れました。元々は別人が開発したものですが、 からダウンバージョンのサポートを提供しましたFroyo。これがあなたを助けることができることを願っています。

AbhanFlipView

参照:

ライブラリ開発者: Emil Sjölander Animations 作成者: Jake Wharton

アップデート

HowTo.txt統合方法を示すという名前のドキュメントがあります。

ありがとう。

于 2013-12-26T13:54:04.853 に答える