Tuesday, 15 January 2013

Linear Layout Example in Android


In main.xml


<?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:orientation="horizontal" >

    <ImageView
        android:id="@+id/contact_image"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/ic_launcher" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <TextView
            android:id="@+id/name_text_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/contact_name" />

        <TextView
            android:id="@+id/phone_number"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/contact_no" />
    </LinearLayout>

</LinearLayout>



Output :






Source Code : Download this Example Here



No comments:

Post a Comment