大多数的APP都可以实现几个屏幕来回的切换,
首先新建两个Activity,内容随意,布局随意。接下来在MainActivity.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</android.support.v4.view.ViewPager>
</<RelativeLayout>
不要忘记android-support-v4包,目前4.0以上版本都自带