Skip to content

Instantly share code, notes, and snippets.

@venkatesh05
Created May 25, 2012 09:56
Show Gist options
  • Save venkatesh05/2787070 to your computer and use it in GitHub Desktop.
Save venkatesh05/2787070 to your computer and use it in GitHub Desktop.
Relative Layout demo
<?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" >
<TextView
android:id="@+id/login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Login"/>
<TextView
android:id="@+id/uname"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="User name" android:layout_below="@id/login"/>
<EditText
android:id="@+id/username"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_weight="1" android:layout_below="@id/uname">
<requestFocus />
</EditText>
<TextView
android:id="@+id/passwordTxt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Password" android:layout_below="@id/username"/>
<EditText
android:id="@+id/password"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:layout_below="@id/passwordTxt"/>
<Button
android:id="@+id/submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Submit"
android:layout_below="@id/passwordTxt"/>
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment