프로그래밍/Android 짜투리 지식
[android] 연속적 이미지 보여주기(gif효과)
선제
2013. 3. 7. 17:42
3.0 허니콤 이하
imgGif = (ImageView)findViewById(R.id.img_gif); aim = (AnimationDrawable) imgGif.getBackground(); imgGif.post(new Runnable() { @Override public void run() { aim.start(); } });
허니콤 이상
AnimationDrawable frame = (AnimationDrawable)imgGif.getBackground(); if(frame.isRunning()) { frame.stop(); } else { frame.stop(); frame.start(); }
animation define
.xml