一丶先上效果图
二丶参考代码
RegistActivity
package com.ythl.shouyoufanli.activity;
import com.ythl.shouyoufanli.R;
import android.app.Activity;
import android.os.Bundle;
/**
* @author Administrator
* 注册帐号界面
*/
public class RegistActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initView();
}
/**
* 初始化控件
*/
private void initView() {
setContentView(R.layout.activity_regist);
}
}
activity_regist.xml
<pre name="code" class="html"><?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#E1E0DE" android:orientation="vertical" > <!-- 引用titlebar --> <include layout="@layout/title_bar" /> <!-- 手机号 --> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="20dp" android:background="@drawable/rounded_edittext" android:paddingBottom="10dp" android:paddingTop="10dp" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:text="手机号" /> <EditText android:id="@+id/et_regist_phonenumber" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:background="@null" android:hint="输入手机号" android:textSize="12sp" /> </LinearLayout> <!-- 验证码 --> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="8dp" android:background="@drawable/rounded_edittext" android:orientation="horizontal" android:paddingBottom="10dp" android:paddingTop="10dp" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:text="验证码" /> <EditText android:id="@+id/et_regist_authcode" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:background="@null" android:hint="输入验证码" android:inputType="text" android:textSize="12sp" /> <TextView android:id="@+id/tv_regist_getensurecode" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="25dp" android:text="获取验证码" android:textColor="#0099cc" android:textSize="12sp" /> </LinearLayout> <!-- 设置密码 --> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="8dp" android:background="@drawable/rounded_edittext" android:paddingBottom="10dp" android:paddingTop="10dp" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:text="设置密码" /> <EditText android:id="@+id/et_regist_pwd" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5dp" android:background="@null" android:hint="6-16位字符,区分大小写" android:inputType="textPassword" android:textSize="11sp" /> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:layout_marginLeft="20dp" android:layout_marginTop="5dp" android:orientation="horizontal" > <!-- 单选框 --> <CheckBox android:id="@+id/cb_regist_checked" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="我同意" android:textSize="10sp" /> <TextView android:id="@+id/tv_regist_deal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/clause" android:textColor="#0099cc" android:textSize="10sp" /> </LinearLayout> <!-- 注册按钮 --> <Button android:id="@+id/bt_regist_ensure" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/ensure_regist_edittext" android:gravity="center" android:text="同意以上协议,马上注册" android:textColor="#ffffff" android:textSize="12sp" /></LinearLayout>
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Demo</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="clause"><u>《快返手游返利平台服务条款》</u></string></resources>
ensure_regist_edittext.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- shape为 矩形 -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle" >
<!-- 填充的颜色 -->
<solid android:color="#0099cc" />
<!-- 设置矩形的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners
android:bottomLeftRadius="7dp"
android:bottomRightRadius="7dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp" />
</shape>
rounded_edittext.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- shape为 矩形 -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle" >
<!-- 填充的颜色 -->
<solid android:color="#FFFFFF" />
<!-- 设置矩形的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners
android:bottomLeftRadius="7dp"
android:bottomRightRadius="7dp"
android:topLeftRadius="7dp"
android:topRightRadius="7dp" />
</shape>