1. 程式人生 > >android實現登入註冊簡易程式碼

android實現登入註冊簡易程式碼

[html] view plain copy print?
  1. <spanstyle="font-family: Arial; font-size: 18px;"><?xmlversion="1.0"encoding="utf-8"?>
  2. <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  3.     android:layout_width="fill_parent"
  4.     android:layout_height="fill_parent"
  5.     android:background=
    "@drawable/bkcolor"
  6.     android:orientation="vertical">
  7.     <LinearLayout
  8.         android:layout_width="fill_parent"
  9.         android:layout_height="50dp"
  10.         android:background="@drawable/topbg2"
  11.         android:gravity="center_vertical"
  12.         android:orientation="horizontal">
  13.         <Button
  14.             android:id="@+id/cancel"
  15.             android:layout_width="65.83dp"
  16.             android:layout_height="30.5dp"
  17.             android:layout_marginLeft="10dp"
  18.             android:background="@drawable/normal_btn"
  19.             android:text="@string/cancel"
  20.             android:textColor="#ffffff"/>
  21.         <
    TextView
  22.             android:id="@+id/tv_friend_title"
  23.             android:layout_width="wrap_content"
  24.             android:layout_height="50dip"
  25.             android:layout_weight="1"
  26.             android:gravity="center"
  27.             android:text="AppName"
  28.             android:textColor="#ffffff"
  29.             android:textSize="20dip"/>
  30.         <Button
  31.             android:id="@+id/login_in"
  32.             android:layout_width="65.83dp"
  33.             android:layout_height="30.5dp"
  34.             android:layout_marginRight="10dp"
  35.             android:background="@drawable/normal_btn"
  36.             android:text="@string/login_in"
  37.             android:textColor="#ffffff"/>
  38.     </LinearLayout>
  39.     <RelativeLayout
  40.         android:id="@+id/editRel"
  41.         android:layout_width="fill_parent"
  42.         android:layout_height="wrap_content">
  43.         <RelativeLayout
  44.             android:id="@+id/accountRel"
  45.             android:layout_width="fill_parent"
  46.             android:layout_height="wrap_content"
  47.             android:layout_marginTop="14dp"
  48.             android:background="@drawable/preference_first_item"
  49.             android:clickable="true"
  50.             android:gravity="center_vertical">
  51.             <TextView
  52.                 android:id="@+id/account"
  53.                 android:layout_width="wrap_content"
  54.                 android:layout_height="wrap_content"
  55.                 android:padding="8dp"
  56.                 android:text="@string/account"
  57.                 android:textColor="#000"
  58.                 android:textSize="17sp"/>
  59.             <EditText
  60.                 android:id="@+id/accountEdittext"
  61.                 android:layout_width="fill_parent"
  62.                 android:layout_height="wrap_content"
  63.                 android:layout_centerVertical="true"
  64.                 android:layout_marginLeft="20dip"
  65.                 android:layout_toRightOf="@id/account"
  66.                 android:background="@null"
  67.                 android:hint="@string/account"
  68.                 android:textSize="15sp"/>
  69.         </RelativeLayout>
  70.         <RelativeLayout
  71.             android:id="@+id/pwdRel"
  72.             android:layout_width="fill_parent"
  73.             android:layout_height="wrap_content"
  74.             android:layout_below="@id/accountRel"
  75.             android:background="@drawable/preference_last_item"
  76.             android:clickable="true"
  77.             android:gravity="center_vertical">
  78.             <TextView
  79.                 android:id="@+id/pwd"
  80.                 android:layout_width="wrap_content"
  81.                 android:layout_height="wrap_content"
  82.                 android:padding="8dp"
  83.                 android:text="@string/pwd"
  84.                 android:textColor="#000"
  85.                 android:textSize="17sp"/>
  86.             <EditText
  87.                 android:id="@+id/pwdEdittext"
  88.                 android:layout_width="fill_parent"
  89.                 android:layout_height="wrap_content"
  90.                 android:layout_centerVertical="true"
  91.                 android:layout_marginLeft="20dip"
  92.                 android:layout_toRightOf="@id/pwd"
  93.                 android:background="@null"
  94.                 android:hint="@string/pwd"
  95.                 android:textSize="15sp"/>
  96.         </RelativeLayout>
  97.     </RelativeLayout>
  98.     <TextView
  99.         android:id="@+id/sound_help"
  100.         android:layout_width="wrap_content"
  101.         android:layout_height="wrap_content"
  102.         android:layout_marginTop="15dip"
  103.         android:layout_marginLeft="15dip"
  104.         android:text="@string/forget_pwd"
  105.         android:textColor="#29981A"/>
  106. </LinearLayout></span>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/bkcolor"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:background="@drawable/topbg2"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/cancel"
            android:layout_width="65.83dp"
            android:layout_height="30.5dp"
            android:layout_marginLeft="10dp"
            android:background="@drawable/normal_btn"
            android:text="@string/cancel"
            android:textColor="#ffffff" />

        <TextView
            android:id="@+id/tv_friend_title"
            android:layout_width="wrap_content"
            android:layout_height="50dip"
            android:layout_weight="1"
            android:gravity="center"
            android:text="AppName"
            android:textColor="#ffffff"
            android:textSize="20dip" />

        <Button
            android:id="@+id/login_in"
            android:layout_width="65.83dp"
            android:layout_height="30.5dp"
            android:layout_marginRight="10dp"
            android:background="@drawable/normal_btn"
            android:text="@string/login_in"
            android:textColor="#ffffff" />
    </LinearLayout>

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

        <RelativeLayout
            android:id="@+id/accountRel"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="14dp"
            android:background="@drawable/preference_first_item"
            android:clickable="true"
            android:gravity="center_vertical" >

            <TextView
                android:id="@+id/account"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="8dp"
                android:text="@string/account"
                android:textColor="#000"
                android:textSize="17sp" />

            <EditText
                android:id="@+id/accountEdittext"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="20dip"
                android:layout_toRightOf="@id/account"
                android:background="@null"
                android:hint="@string/account"
                android:textSize="15sp" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/pwdRel"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/accountRel"
            android:background="@drawable/preference_last_item"
            android:clickable="true"
            android:gravity="center_vertical" >

            <TextView
                android:id="@+id/pwd"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="8dp"
                android:text="@string/pwd"
                android:textColor="#000"
                android:textSize="17sp" />

            <EditText
                android:id="@+id/pwdEdittext"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="20dip"
                android:layout_toRightOf="@id/pwd"
                android:background="@null"
                android:hint="@string/pwd"
                android:textSize="15sp" />
        </RelativeLayout>
    </RelativeLayout>

    <TextView
        android:id="@+id/sound_help"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="15dip"
        android:layout_marginLeft="15dip"
        android:text="@string/forget_pwd"
        android:textColor="#29981A" />

</LinearLayout>