Posts

Showing posts with the label Android - Image Switcher Tutorial

Android - Image Switcher Tutorial

Image
Sometimes you don't want an image to appear abruptly on the screen, rather you want to apply some kind of animation to the image when it transitions from one image to another. This is supported by android in the form of ImageSwitcher. An image switcher allows you to add some transitions on the images through the way they appear on screen. In order to use image Switcher, you need to define its XML component first. Its syntax is given below − <ImageSwitcher android:id = "@+id/imageSwitcher1" android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:layout_centerHorizontal = "true" android:layout_centerVertical = "true" > </ImageSwitcher> Now we create an intance of ImageSwithcer in java file and get a reference of this XML component. Its syntax is given below − private ImageSwitcher imageSwitcher; imageSwitcher = (ImageSwitcher)findViewById(R.id.imageSwitcher1); Th...