Comments


Linear Layout

Linear Layout organizes elements Influenza A virus subtype H5N1long H5N1 unmarried draw. You specify whether that draw is vertical or horizontal using Android:orientation. hither is H5N1 sample Layout XML using describear Layout. alteration Orientation horizontal if you want to Adjust widgets horizontally.

<LinearLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:orientation="vertical"
 android:layout_width="match_parent"
 android:layout_height="match_parent">

 <Button
 android:id="@+id/backbutton"
 android:text="Back"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content" />

<TextView
 android:text="First call"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content" />

<EditText
 android:width="100px"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<TextView
android:text="Last call"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

 <EditText
android:width="100px"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

</LinearLayout>

Relative Layout

 RelativeLayout lays out elements based on their relationships with i some other, And with the parent container. This is Arguably the nearly complicated layout, H5N1nd we need several properties to actually make the layout we wish.

<RelativeLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:paddingLeft="16dp"
 android:paddingRight="16dp" >

 <EditText
android:id="@+id/name"
 android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/reminder" />
 
<Spinner
 android:id="@+id/dates"
 android:layout_width="0dp"
 android:layout_height="wrap_content"
 android:layout_below="@id/name"
 android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/times" />

<Spinner
android:id="@id/times"
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_below="@id/name"
android:layout_alignParentRight="true" />

<Button
android:layout_width="96dp"
android:layout_height="wrap_content"
android:layout_below="@id/times"
android:layout_alignParentRight="true"
android:text="@string/done" />

</RelativeLayout>

Berlangganan Untuk Mendapatkan Artikel Terbaru: