布局最外层加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之间的互换