2012-12-27 5 views
0

어떻게 애니메이션을 멈출 수 있습니까 (.stop()로 생각할 수 있습니다). 그런 다음 애니메이션의 그림이 정적으로 나타나야합니다. 두 번째 사진은 표시된 사진이어야합니다.애니메이션 - 애니메이션 정지 및 애니메이션에서 특정 이미지 표시

어떻게하면됩니까?

을 heres XML 애니메이션 목록 : 나는 몇 시간 조사 후 자신에 의해 그것을 해결 한

<?xml version="1.0" encoding="utf-8"?> 
<animation-list xmlns:android="http://schemas.android.com/apk/res/android" > 
    <item android:drawable="@drawable/app" android:duration="1200"/> 
<item android:drawable="@drawable/app2" android:duration="250"/> 
</animation-list> 

답변

0

.

Object tag = layout.getTag(); 
    int backgroundId = R.drawable.night; 

    if(tag != null && ((Integer)tag).intValue() == backgroundId) { 
     backgroundId = R.drawable.day; 
     playAnimation(); 
    } 
    else 
    { 
     animatedLoerg.selectDrawable(1); 
     animatedLoerg.stop(); 
    } 

    layout.setTag(backgroundId); 
    layout.setBackgroundResource(backgroundId); 

태그와 함께 해결되었습니다.

관련 문제