【Android】[3]如何制作引导页轮播图

前言

运行效果:

Android引导页

源码地址:

https://github.com/littlecurl/AppProjects

进去找AndroidGuide或者AndroidGuide.zip进行下载

简单介绍:

今天介绍的是一款由国人开源的第三方库,GitHub地址:https://github.com/youth5201314/banner,我看到的时候,star已经8000+了,每当看到这种国人开源库被广泛使用的时候,就像周董说的那样“我不知道作者骄傲不骄傲,反正老子挺骄傲的”。

正文

首先要在gridle文件中引入两个库:

    // banner 轮播
    implementation 'com.youth.banner:banner:1.4.10'
	// Glide
    implementation 'com.github.bumptech.glide:glide:4.9.0'

然后是xml布局

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">
    <!-- 轮播图 -->
    <com.youth.banner.Banner
        android:id="@+id/guide_banner"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
    <!-- 开始按钮 -->
    <ImageView
        android:id="@+id/iv_start"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值