그럼 당신은 이미지 뷰와 FrameLayout이있는 텍스트 뷰 넣을 수 있습니다 : 당신은 당신이 원하는 애니메이션의 어떤 종류의 지정하지 않은 애니메이션으로
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/building"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/your_building_image" />
<TextView
android:id="@+id/number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
을 (페이드 인/아래로 밀어/left/right, etc.). 숫자가 포함 된 TextView를 애니메이션으로 만들려고 할 때마다 아래에 설명 된 것과 같이해야합니다.
애니메이션에 대한 작업에서 메소드를 만듭니다 (예는 페이드입니다). 애니메이션 있음) :
private Animation fadeInAnimation() {
Animation animation = new AlphaAnimation(0f, 1.0f);
animation.setDuration(1000); // in milliseconds
animation.setFillEnabled(true);
animation.setFillAfter(true);
return animation;
}
number.setText(yourRandomNumber.toString());
number.startAnimation(fadeInAnimation());
:
...
TextView number = (TextView) findViewById(R.id.number);
위의 메소드를 호출하여 텍스트 뷰를 애니메이션