1效果图:
项目结构:
这个是用 ImageSwitcher 和 Gallery 实现的,
在https://blog.csdn.net/zhaihaohao1/article/details/100169211中
我们使用的时 ImageView,ImageView 大图切换的时候,没有动画效果,看起来有些生硬,
在这里把ImageView换成ImageSwitcher ,ImageSwitcher 可以显示切换动画
ViewPager也能实现类似效果,所以放到ViewPager的分类中
activity_main.xml中
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/layout1"
android:gravity="center_horizontal"
>
<ImageSwitcher
android:id="@+id/imageSwitcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="30px"
android:layout_gravi