(2011-10-06 19:56:08)
一個普通登入介面的代碼,主要是三個EditText,一個checkBox,兩個button
<?xml version="1.0" encoding="utf-8" ?><LinearLayout xmlns:android="
http://schemas.android.com/apk/res/android" android:orientation="
vertical" android:layout_width="
fill_parent" android:layout_height="
fill_parent" android:background="
@drawable/background_login"><TextView android:id="
@+id/login_user_num" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:textSize="
25px" android:layout_marginLeft="
40px" android:textStyle="
bold" android:text="
移動物流手機用戶端" android:textColor="
#000000" style="
@style/normalText" /> <RelativeLayout android:id="
@+id/login_div" android:layout_width="
fill_parent" android:layout_height="
wrap_content" android:padding="
15dip" android:layout_margin="
15dip" android:background="
@drawable/background_login_div_bg"><TextView android:id="
@+id/login_user_num" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:text="
工號" style="
@style/normalText" /><EditText android:id="
@+id/usernum_edit" android:layout_width="
fill_parent" android:layout_height="
wrap_content" android:layout_below="
@id/login_user_num" android:hint="
@string/login_work_num_hint" android:singleLine="
true" android:inputType="
text" /><TextView android:id="
@+id/login_user_input" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:layout_below="
@id/usernum_edit" android:text="
@string/login_label_userID_num" style="
@style/normalText" /><EditText android:id="
@+id/username_edit" android:layout_width="
fill_parent" android:layout_height="
wrap_content" android:hint="
@string/login_userID_num_hint" android:layout_below="
@id/login_user_input" android:singleLine="
true" android:inputType="
text" /><TextView android:id="
@+id/login_password_input" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:layout_below="
@id/username_edit" android:layout_marginTop="
3dp" android:text="
@string/login_label_password" style="
@style/normalText" /><EditText android:id="
@+id/password_edit" android:layout_width="
fill_parent" android:layout_height="
wrap_content" android:layout_below="
@id/login_password_input" android:password="
true" android:singleLine="
true" android:inputType="
textPassword" /><CheckBox android:id="
@+id/cbRemember" android:text="
@string/cbRemember" android:layout_gravity="
center_horizontal" android:checked="
false" android:textColor="
@color/character" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:layout_below="
@id/password_edit" /><Button android:id="
@+id/signin_button" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:layout_below="
@id/password_edit" android:layout_alignRight="
@id/password_edit" android:text="
@string/login_label_signin" /></RelativeLayout> <RelativeLayout android:layout_width="
fill_parent" android:layout_height="
wrap_content"><TextView android:id="
@+id/register_link" android:text="
@string/login_register_link" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:layout_marginLeft="
15dp" android:textColor="
#888" android:textColorLink="
#FF0066CC" /><Button android:id="
@+id/register_button" android:layout_toRightOf="
@id/register_link" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:layout_alignTop="
@id/register_link" android:text="
註冊" /><ImageView android:id="
@+id/miniTwitter_logo" android:src="
@drawable/cat" android:layout_width="
wrap_content" android:layout_height="
wrap_content" android:layout_alignParentRight="
true" android:layout_alignParentBottom="
true" android:layout_marginRight="
25dp" android:layout_marginLeft="
10dp" android:layout_marginBottom="
25dp" /></RelativeLayout></LinearLayout>如下: