Relative layout RelativeLayout Android example

xml RelativeLayout Android example:

Eclipse graphical xml layout editor

relativelayout-graphical-editor-eclipse

Relativelayout Eclipse graphical editor

res/layout/main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
        android:id="@+id/idLabel"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Enter word"/>
    <EditText
        android:id="@+id/idEntry"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@android:drawable/editbox_background"
        android:layout_below="@id/idLabel"/>
    <Button
        android:id="@+id/idOk"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/idEntry"
        android:layout_alignParentRight="true"
        android:layout_marginLeft="10dip"
        android:text="OK" />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@id/idOk"
        android:layout_alignTop="@id/idOk"
        android:text="Cancel" />
</RelativeLayout>
This entry was posted in Android Examples Code and tagged , , , , . Bookmark the permalink.


Comments are closed.



5,552 views