如何在android中实现注册/注册?

时间:2013-12-24 03:42:08

标签: android registration progress

我想设置一个包含多个步骤的用户注册。每个步骤都将以条形图突出显示。深灰色条将是完成的步骤,浅灰色条将是需要完成的步骤。似乎没有想到这样做的方法。请建议。

我们可以在myfitnesspal注册中看到这一点。我在下面的图片中用红框突出显示了这一点。

enter image description here

3 个答案:

答案 0 :(得分:0)

如果您对连续栏感到满意,可以使用自定义进度条,如this answer中所述。

如果您真的想要图片中的各个片段,则可能需要创建“浅色”和“暗色”图像资源,并将一堆ImageView放置在水平LinearLayout中。下一步,您只需将ImageView的drawable更改为“dark”图像资源。

答案 1 :(得分:0)

<RelativeLayout
        android:id="@+id/layout"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:id="@+id/tab_layout"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/step1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="-5dp"
                android:background="@drawable/tab_active" />

            <Button
                android:id="@+id/step2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="-5dp"
                android:background="@drawable/tab_active" />

           <Button
                android:id="@+id/step3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="-5dp"
                android:background="@drawable/tab_active" />

           <Button
                android:id="@+id/step4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="-5dp"
                android:background="@drawable/tab_active" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/steptitle"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/tab_layout" >

            <TextView
                android:id="@+id/eventItemTitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:ellipsize="end"
                android:paddingLeft="15dp"
                android:singleLine="true"
                android:text="@string/symptomstitlebar"
                android:textColor="@color/white_color"
                android:textSize="14sp"
                android:textStyle="bold" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/content"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/event_title_layout"
            android:orientation="horizontal"
            android:paddingLeft="10dp"
            android:paddingRight="10dp" >

            <include
                android:id="@+id/stepContent"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                layout="@layout/event_tab_layout" />
        </LinearLayout>
    </RelativeLayout>

尝试这样的布局并定义片段以动态更改内容

答案 2 :(得分:0)

相关问题