app的引导页很多都是用viewpager做的,小面还有一个小圆点,会根据页面切换,但是有些app引导页的小圆点会随着页面的滑动而滑动,而不是机器式的直接跳到下一页.
上图:
简单做法:
- 写布局
<?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">
<!--用一个viewpager来展示滑动效果-->
<android.support.v4.view.ViewPager
android:id="@+id/vp_guide"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v4.view.ViewPager>
<!--开始体验的按钮,刚开始不可见-->
<Button
android:id="@+id/btn_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"