ViewPager圆圈指示器

时间:2018-01-01 15:23:50

标签: android android-fragments android-viewpager viewpagerindicator

我正在尝试创建一个有4个片段的UI。前两个片段应该有一个像图像1的视图寻呼机指示器,而后两个片段必须有指示器作为图像2。 enter image description here Image 2

截至目前,我一直在使用普通的ViewPager / CircleIndicator组合。但圆圈指示器总是在底部,类似于图像2(是啊,duh)。我如何实现上述UI? 我是否创建了自定义viewpager?

任何帮助/推动我正确方向的人都会受到赞赏!

编辑:

注册活动:

<LinearLayout 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:orientation="vertical"
android:background="@drawable/splashbg"
android:weightSum="4"
android:layout_height="match_parent"
tools:context="biz.wrinklefree.wrinklefree.SignUpActivity">

<biz.wrinklefree.wrinklefree.CustomViewPager
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_weight="3"
    android:id="@+id/viewpager">

</biz.wrinklefree.wrinklefree.CustomViewPager>

<me.relex.circleindicator.CircleIndicator
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:id="@+id/circleindicator"
    android:layout_weight="1">
</me.relex.circleindicator.CircleIndicator>

</LinearLayout>

其中一个片段(需要添加更多元素,如文本字段和按钮):

<LinearLayout 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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context="biz.wrinklefree.wrinklefree.UserRegOne">

<!-- TODO: Update blank fragment layout -->
<android.support.design.widget.TextInputLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:hintAnimationEnabled="true">

    <EditText
        android:layout_width="200dp"
        android:layout_height="50sp"
        android:hint="Username"
        android:textColorHint="#000"/>

</android.support.design.widget.TextInputLayout>

<Button
    android:id="@+id/clik"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Click" />
</LinearLayout>

0 个答案:

没有答案
相关问题