Code example for ImageSwitcher

Methods: setFactory, setInAnimation, setOutAnimation

0
		}); 
 
	} 
 
	private void setupImageSwitcher() { 
		imageSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
				android.R.anim.fade_in));
		imageSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
				android.R.anim.fade_out));
 
		imageSwitcher.setFactory(new ViewSwitcher.ViewFactory() {
 
			@Override 
			public View makeView() {
 
				ImageView imageView = new ImageView(ExemploSpinner.this);
				//imageView.setBackgroundColor(0xFF0000); 
				imageView.setScaleType(ImageView.ScaleType.CENTER);
				imageView.setLayoutParams(new ImageSwitcher.LayoutParams(
						LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));