最基本的滑动:ViewFlipper 中包含多个View ,View之间的切换。
配置文件layout_viewflipper.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"
- >
- <ViewFlipper
- android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:id="@+id/viewFipper01">
- <include android:id="@+id/layout1" layout="@layout/layout_view1"/>
- <include android:id="@+id/layout2" layout="@layout/layout_view2"/>
- </ViewFlipper>
- </LinearLayout>
对应的layout_view1.xml和layout_view2.xml
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height