安卓启动页和引导页的制作

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,我

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值