利用图形切换控件中轮流显示图片,并有慢进慢出的动画效果
ImageSwitcher控件可以在不同的图像之间切换,其中的切换过程可以采用动画的方法,如淡入淡出的效果。
(一)、图形切换控件轮流显示图片步骤如下:
1、既然要设置图形切换控件,首先我们得设计自己的界面,将图形切换控件布置到我们的页面上面,设计的XML的代码如下:
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".work7">
android:layout_marginTop="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:id="@+id/imageSwitcher">
android:layout_width="match_parent"
android:layout_marginTop="15dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/imageButton"
android:background="@drawable/button_shape1"
android:text="上一张"/>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="