create textbox,label and button in android

by mariganesh 2013-03-01 10:18:01

create textbox,label and button in android

In activity_main.xml




<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android: paddingBottom="@dimen/activity_vertical_margin"
android: paddingLeft="@dimen/activity_horizontal_margin"
android: paddingRight="@dimen/activity_horizontal_margin"
android: paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

//create text box

<EditText
android:id="@+id/mnum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button1"
android:layout_alignParentLeft="true"
android:layout_marginBottom="30dp"
android:layout_marginLeft="96dp"
android:ems="10" />

//create label

<TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText2"
android:layout_alignRight="@+id/editText2"
android:layout_below="@+id/button1"
android:layout_marginTop="45dp" />

//create button

<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/email"
android:layout_alignParentTop="true"
android:layout_marginLeft="46dp"
android:layout_marginTop="170dp"
android:onClick="searchInUrl"
android:text="@string/button1" />

815
like
0
dislike
0
mail
flag

You must LOGIN to add comments