下面是安卓启动引导图的实现,话不多说,直接上代码。
1.布局文件:activity_guide.xml
<?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/guide_vp"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/ll_guide_point"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="40dp"
android:gravity="center_horizontal"
android:orientation="horizontal" />
<ImageButton
android:id="@+id/guide_ib_start"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center_vertical"
android:layout_marginBottom="120dp"
android:src="@mipmap/img_guide_start"
android:visibility="gone" />
</RelativeLayout>
2.关于的ViewPager的适配器GuidePageAdapter.java
/**
* Created by gdk on 2019/7/22 14:55
* Describe:安装apk第一次启动的引导页
*
* @author gdk
*/
public class GuidePageAdapter extends PagerAdapter {
//存放图片的集合
private List<View> viewList;
public GuidePageAdapter(List<View> viewList) {
this.viewList = viewList;
}
/**
* @ret

本文介绍了一种安卓应用启动时的引导图实现方法,通过自定义ViewPager和指示点来展示一系列引导图片,并提供了完整的代码示例。
最低0.47元/天 解锁文章
1325

被折叠的 条评论
为什么被折叠?



