Days:Hrs:Mins:Secをカウントするカウントダウンタイマーを作成しました。通常のテキストビューを使用し、ハンドラーを使用して更新すると、問題なく機能します。しかし、私は変化する数字のためのクールなアニメーションを作成したいと思います:1番目のQ:
数字を描くための2つのオプションがあります。1。スタイルを適用した自家製フォントを使用する2.テキストを含まないtextview/btnを使用する方法と、setBackgroundResource()を使用して背景画像を適用する方法
-何を選べばいいですか?
2番目のQ:
ViewFlipperのラッパーを作成しました(拡張していません)
public class transitionair extends Activity {
SpecialFlipperWrapper m_thousand;
SpecialFlipperWrapper m_hundred;
SpecialFlipperWrapper m_tens;
SpecialFlipperWrapper m_ones;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
ViewFlipper flipper_Tsnds=(ViewFlipper)findViewById(R.id.yearThousand);
m_thousand = new SpecialFlipperWrapper(flipper_Tsnds, this, 9);
ViewFlipper flipper_Hndrds=(ViewFlipper)findViewById(R.id.yearHundread);
m_hundred = new SpecialFlipperWrapper(flipper_Hndrds, this, 9);
ViewFlipper flipper_Tns=(ViewFlipper)findViewById(R.id.yearTens);
m_tens = new SpecialFlipperWrapper(flipper_Tns, this, 9);
ViewFlipper flipper_Ons=(ViewFlipper)findViewById(R.id.yearOnes);
m_ones = new SpecialFlipperWrapper(flipper_Ons, this, 9);
m_thousand.startFlipping();
m_hundred.startFlipping();
m_tens.startFlipping();
m_ones.startFlipping();
}}
ただし、yearThousandidの後に来る後者のビューの1つをフェッチしようとするとnullが取得されます
私が使用しているXMLは次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<ViewFlipper
android:id="@+id/yearThousand"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ViewFlipper
android:id="@+id/yearHundread"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ViewFlipper
android:id="@+id/yearTens"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ViewFlipper
android:id="@+id/yearOnes"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
アニメーション自体のpsxmlが機能しているので、省略しました
主な質問は次のとおりです。私はそれをより良くすることができますか?2番目の質問は:どのように?3番目の質問は、2回目の呼び出しでレイアウトがnullを返すのはなぜですか、それを回避するにはどうすればよいですか?
10XX