2012-05-09 5 views
1

나는 Android 위젯에서 텍스트 애니메이션을 얻으려고 노력해 왔습니다. 특히, 텍스트를 페이드 인하 고 싶습니다.Android 위젯에서 텍스트 애니메이션하기

대부분의 Android 핸드셋과 함께 제공되는 Genie News 및 Weather 위젯이 가능하기 때문에 가능하다고 알고 있습니다. 그러나 애니메이터 또는 텍스트 스위처 (어느 쪽도 지원되지 않는 것 같습니다)를 사용하여 이것이 어떻게 수행되는지는 알 수 없습니다.

나는이 애니메이션이 총 잔인한 것처럼 보이기 때문에 알람을 사용하여 완료되지 않았다고 가정합니다.

누구에게 이것이 어떻게 수행되는지 압니까? http://developer.android.com/guide/topics/resources/animation-resource.html#alpha-element

당신이 애니메이션이 시작 하시겠습니까 :

답변

1

당신은 프로그래밍 ... 다음은 XML 파일에 정의 된 알파 애니메이션을 사용하거나 수있는 애니메이션에 대한 문서입니까?

2

당신이 현재 텍스트를 페이드 아웃하고 새 텍스트에 사라질 것이다 textSwitcher에의 setText를 호출하는 경우 해당

<TextSwitcher 
    android:id="@+id/switcher" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:inAnimation="@android:anim/fade_in" 
    android:outAnimation="@android:anim/fade_out" > 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:text="Hello" /> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:text="World" /> 
    </TextSwitcher> 

에 대한 ViewSwitcher 또는 TextSwitcher를 사용할 수 있습니다.


사용자는 프로그래밍 방식으로 모든보기 개체에 대한 애니메이션을 시작할 수도 있습니다.

Animation fadeIn = AnimationUtils.loadAnimation(getApplicationContext(), android.R.anim.fade_in); 
textView.startAnimation(fadeIn); 
관련 문제