Android에서 도움이 필요합니다. 슬롯 머신 게임을 만들려고합니다. 그래서 저는 AnimationDrawable을 3 개의 휠에 사용하고 있습니다. 는Android : AnimationDrawable에서 현재 프레임을 얻는 방법
android:background="@drawable/animwheel"
이제 배경 : 나는 속성 안드로이드를 사용하여 메인 레이아웃의 3 가지보기 (세 whells)의 애니메이션 목록을 퍼트
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/animWheel"
android:oneshot="false" >
<item
android:drawable="@drawable/fruits1"
android:duration="200"/>
<item
android:drawable="@drawable/fruits2"
android:duration="200"/>
<item
android:drawable="@drawable/fruits3"
android:duration="200"/>
</animation-list>
다음은 animwheel.xml 파일입니다 사용자는 세 가지 다른 버튼을 클릭하여 애니메이션을 중지 할 수 있습니다. 문제는 뷰가 현재 표시하고있는 그림이 무엇인지 어떻게 알 수 있습니까? getCurrentFrame() 메소드 또는 이와 유사한 것이 있습니까?
미리 감사드립니다.
여기에서 AnimationDrawable (http://goo.gl/e7kFU)를 읽은 다음에는 변수 이름이 mCurFrame 인 애니메이션 애니메이션 프레임을 추적합니다. 그러나 불행히도, 그것은 사적입니다. 그들이 공개로 설정하면 더 유용 할 것입니다. – anticafe