【main.xml】
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/addtoplayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<EditText
android:id="@+id/edittext_contactname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/edittext_contactname_hint" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/contactstypestr" />
<Spinner
android:id="@+id/spinner_contactstype"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/phone" />
<EditText
android:id="@+id/edittext_phone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/phone" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/email" />
<EditText
android:id="@+id/edittext_email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/email" />
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" >
<Button
android:id="@+id/btnSaveContact"
android:layout_width="160dip"
android:layout_height="wrap_content"
android:text="@string/savecontact" />
<Button
android:id="@+id/btnCancelContact"
android:layout_width="160dip"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/btnSaveContact"
android:text="@string/cancel" />
</RelativeLayout>
</RelativeLayout>