ImageSwitcher에서 기본애니메이션을 통해 구성하기.
IT/Android
2017. 12. 31. 03:07
728x90
ImageSwitcher imageSwitcher = (ImageSwitcher)findViewById(R.id.view); imageSwitcher.setFactory(new ViewSwitcher.ViewFactory() { @Override public View makeView() { ImageView imageView = new ImageView(getApplicationContext()); return imageView; } }); //기본애니메이션 in, out 가져오기 Animation in = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left); Animation out = AnimationUtils.loadAnimation(this, android.R.anim.slide_out_right); //애니메이션 설정 imageSwitcher.setInAnimation(in); imageSwitcher.setOutAnimation(out);