登陆注册页面实现上下滑动,方便输入

布局最外层加ScrollView

<RelativeLayout 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"
    android:background="@color/white"
    tools:context="com.obdpay.obdpay.login">

    <ScrollView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="35dp">

                <ImageButton
                    android:layout_width="28dp"
                    android:layout_height="28dp"
                    android:background="#0000"
                    android:src="@mipmap/back_blue"
                    android:layout_centerVertical="true"
                    android:id="@+id/login_back_button"
                    android:layout_alignParentLeft="true"
                    android:layout_marginLeft="7dp"
                    android:scaleType="fitXY"
                    />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="0dp"
                    android:layout_centerVertical="true"
                    android:layout_centerHorizontal="true"
                    android:text="@string/main_log_btn_title"
                    android:textSize="16sp"
                    android:textColor="@color/blue_text_color"
                    />

            </RelativeLayout>

            <ImageButton
                android:layout_width="80dp"
                android:layout_height="80dp"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="80dp"
                android:background="@color/transparent"
                android:src="@mipmap/bigme_blue"
                android:scaleType="fitXY"
                android:id="@+id/login_title_image"/>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/login_title_image"
                android:id="@+id/phone_num_part"
                android:layout_marginLeft="40dp"
                android:layout_marginRight="40dp"
                android:layout_marginTop="45dp"
                android:background="@color/back_color_transparent">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginTop="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginBottom="5dp"
                    android:background="@color/white"
                    >

                    <ImageView
                        android:layout_width="30dp"
                        android:layout_height="30dp"
                        android:layout_marginLeft="5dp"
                        android:layout_centerVertical="true"
                        android:background="@color/white"
                        android:src="@mipmap/miniphone"/>

                    <View
                        android:layout_width="1dp"
                        android:layout_height="match_parent"
                        android:background="@color/back_color_transparent"
                        android:layout_marginLeft="40dp">

                    </View>

                    <EditText
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="41dp"
                        android:id="@+id/phone_input"
                        android:textSize="17sp"
                        android:inputType="number"
                        android:background="@color/white"
                        android:paddingLeft="10dp"
                        android:textColorHint="@color/gray_title_color"
                        android:hint="@string/input_phone_number"/>

                </RelativeLayout>

            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/phone_num_part"
                android:id="@+id/password_num_part"
                android:layout_marginLeft="40dp"
                android:layout_marginRight="40dp"
                android:layout_marginTop="20dp"
                android:background="@color/back_color_transparent">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginTop="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginBottom="5dp"
                    android:background="@color/white"
                    >

                    <ImageView
                        android:layout_width="30dp"
                        android:layout_height="30dp"
                        android:layout_marginLeft="5dp"
                        android:layout_centerVertical="true"
                        android:background="@color/white"
                        android:src="@mipmap/minipassword"/>

                    <View
                        android:layout_width="1dp"
                        android:layout_height="match_parent"
                        android:background="@color/back_color_transparent"
                        android:layout_marginLeft="40dp">

                    </View>

                    <EditText
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="41dp"
                        android:id="@+id/code_input"
                        android:textSize="17sp"
                        android:background="@color/white"
                        android:paddingLeft="10dp"
                        android:inputType="textPassword"
                        android:textColorHint="@color/gray_title_color"
                        android:hint="@string/input_password"/>

                </RelativeLayout>

            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/password_num_part"
                android:id="@+id/verify_part"
                android:layout_marginLeft="40dp"
                android:layout_marginRight="40dp"
                android:layout_marginTop="20dp"
                android:background="@color/back_color_transparent">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginTop="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginBottom="5dp"
                    android:background="@color/white"
                    >

                    <EditText
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginLeft="0dp"
                        android:layout_marginRight="150dp"
                        android:id="@+id/verify_pic_input"
                        android:textSize="17sp"
                        android:background="@color/white"
                        android:paddingLeft="10dp"
                        android:textColorHint="@color/gray_title_color"
                        android:hint="请输入验证码"/>

                    <View
                        android:layout_width="1dp"
                        android:layout_height="match_parent"
                        android:layout_alignParentRight="true"
                        android:layout_marginRight="150dp"
                        android:background="@color/back_color_transparent"
                        android:layout_marginLeft="40dp">
                    </View>

                    <ImageView
                        android:layout_width="150dp"
                        android:layout_height="30dp"
                        android:layout_alignParentRight="true"
                        android:layout_centerVertical="true"
                        android:background="@color/white"
                        android:id="@+id/login_image_part"
                        android:scaleType="fitCenter"
                        />

                </RelativeLayout>

            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:layout_below="@id/verify_part"
                android:id="@+id/login_button_part"
                android:layout_marginLeft="40dp"
                android:layout_marginRight="40dp"
                android:layout_marginTop="35dp"
                android:background="@color/back_color_transparent">

                <Button
                    android:id="@+id/login_button"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:gravity="center"
                    android:background="@mipmap/login_blue_button"
                    android:text="@string/main_log_btn_title"
                    android:textSize="17sp"
                    android:textColor="@color/white"/>
            </RelativeLayout>

            <Button
                android:id="@+id/forget_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/login_button_part"
                android:layout_alignRight="@id/login_button_part"
                android:layout_marginTop="10dp"
                android:background="@color/transparent"
                android:text="@string/forgot_password"
                android:textSize="17sp"
                android:textColor="@color/blue_text_color"/>
        </RelativeLayout>
    </ScrollView>



</RelativeLayout>

这里验证码的imageview不能设置点击事件???
drawableu与drawable之间的互换

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值