我想在我的应用程序中添加介绍屏幕。它应该从一页滑到另一页。我想添加 3 个屏幕。像这样的屏幕:
底部有3个点。我想实现这些。此外,当它滑到下一页时,它的颜色会发生变化,并且位置也会变化到中间的点。
我找到了一个为此提供默认结构的库。因为他们在屏幕底部给出了点,并在左侧跳过并在右侧完成。
https://github.com/PaoloRotolo/AppIntro 。
这是我要找的图书馆。我可以根据需要实施吗?
但我想要像我在这里展示的图像那样的布局。我怎样才能做到这一点?
现在我已经创建了布局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg"
android:weightSum="1">
<ImageView
android:layout_width="180dp"
android:layout_height="50dp"
android:id="@+id/imageView9"
android:layout_gravity="center_horizontal"
android:background="@drawable/logo_g"
android:layout_marginTop="20dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<ImageView
android:layout_width="200dp"
android:layout_height="160dp"
android:id="@+id/imageView10"
android:layout_gravity="center"
android:layout_centerHorizontal="true"
android:layout_below="@+id/imageView9"
android:layout_marginTop="30dp" />
<TextView
android:layout_width="220dp"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/walkthrough1"
android:id="@+id/textView3"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:textAlignment="center"
android:textStyle="bold"
android:layout_below="@+id/imageView10"
android:layout_centerHorizontal="true"
android:textColor="@android:color/black" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_below="@+id/textView3"
android:id="@+id/linearLayout8"
android:layout_alignLeft="@+id/button2"
android:layout_alignStart="@+id/button2"
android:layout_alignRight="@+id/button2"
android:layout_alignEnd="@+id/button2">
<View
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/circle"></View>
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SIGN UP"
android:id="@+id/button2"
android:background="#66BB6A"
android:textColor="@android:color/white"
android:layout_below="@+id/linearLayout8"
android:layout_centerHorizontal="true"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="SKIP"
android:id="@+id/textView4"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:textColor="@android:color/black" />
</RelativeLayout>
我想在点的位置添加 3 个圆形视图,并在它滑动到下一页时改变它的颜色。但我不确定如何获得这样的点视图以及如何从一页滑到另一页。
有人可以帮忙吗?谢谢你..