Input Controls

Input Controls in Android

XML FILE

<?xml version=”1.0″ encoding=”utf-8″?>
<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=”com.example.malik.test.MainActivity”>
<Button
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=”Only Text”
android:id=”@+id/button”
android:layout_above=”@+id/imageButton”
android:layout_alignParentLeft=”true”
android:layout_alignParentStart=”true”
android:layout_marginLeft=”88dp”
android:layout_marginStart=”88dp”
android:layout_marginBottom=”40dp” />

<ImageButton
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:id=”@+id/imageButton”
android:src=”@android:drawable/ic_lock_idle_alarm”
android:layout_above=”@+id/button2″
android:layout_alignLeft=”@+id/button”
android:layout_alignStart=”@+id/button”
android:layout_marginBottom=”39dp” />

<Button
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=” Text &amp; Image ”
android:id=”@+id/button2″
android:drawableLeft=”@drawable/ic_info_white_24dp”
android:layout_centerVertical=”true”
android:layout_alignLeft=”@+id/imageButton”
android:layout_alignStart=”@+id/imageButton” />
<Button
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:text=” Text &amp; Image ”
android:id=”@+id/button3″
android:drawableRight=”@drawable/ic_cached_black_24dp”
android:layout_below=”@+id/button2″
android:layout_alignLeft=”@+id/button2″
android:layout_alignStart=”@+id/button2″
android:layout_marginTop=”49dp” />
</RelativeLayout>

 

Output :

pic

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.