안드로이드 개발 질문/답변
(글 수 45,052)
책에서 본 예제대로 구현을 해봤는데 첫번째 그림만 나올뿐 애니메이션이 동작하지 않습니다.
검색해보니 onCreate() 에서 안된다는 말도 있어서 따로 메소드 만들어서 구현해도 똑같더군요.
혹시 아시는분은 해결책좀 부탁드리겠습니다.
감사합니다.
검색해보니 onCreate() 에서 안된다는 말도 있어서 따로 메소드 만들어서 구현해도 똑같더군요.
혹시 아시는분은 해결책좀 부탁드리겠습니다.
감사합니다.
ImageView img = (ImageView)findViewById(R.id.picture); BitmapDrawable frame1 = (BitmapDrawable)getResources().getDrawable(R.drawable.chest00); BitmapDrawable frame2 = (BitmapDrawable)getResources().getDrawable(R.drawable.chest01); int reasonableDuration = 250; AnimationDrawable mAnimation = new AnimationDrawable(); mAnimation.addFrame(frame1, reasonableDuration); mAnimation.addFrame(frame2, reasonableDuration); img.setBackgroundDrawable(mAnimation); mAnimation.setOneShot(false); mAnimation.start();