1,先在布局中设置启动页的图片
<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"
android:background="@drawable/splash_bg_newyear"
tools:context=".MainActivity" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/splash_horse_newyear"
android:scaleType="fitXY" />
</RelativeLayout>
2,然后在布局中设置启动页,启动页其实就是一个viewPager,但是这里的viewPager必须是v4包下的,因为v4包是向下兼容的,如果版本低的安卓手机也同样适用
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:paddingLeft="30dp"
android:paddingRight="30dp"
android:text="@string/kaishi"
android:textSize="20sp"
android:visibility="gone" />
</RelativeLayout>
3,进入主界面,设置主界面的布局
这个主界面的布局任意,你想加载什么样的效果就设置什么样的布局,这里就不赘述了,任意一个布局都OK,我