Friday, 12 October 2012

ANDROID - Login Form Design 4











Setting Backgound Color











Xml Code:
-----------

<?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:layout_gravity="center|center_vertical"
    android:background="@color/myColor"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/tvUserName"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:text="UserName"
        android:textColor="@color/myFontColor"
        android:textStyle="bold" />

    <EditText
        android:id="@+id/edtUserName"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/tvPassword"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Password"
        android:textColor="@color/myFontColor"
        android:textStyle="bold"/>

    <EditText
        android:id="@+id/edtPassword"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:password="true" />

    <Button
        android:id="@+id/btnLogin"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Login" />

    <Button
        android:id="@+id/btnCancel"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Cancel" />

</LinearLayout>


Strings.xml:
------------

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <color name="myColor">#C67D33</color>
    <color name="myFontColor">#191A18</color>

</resources>

No comments:

Post a Comment