Wednesday, May 5, 2010

Creating Interfaces in XML

To save time and trouble, use the droiddraw.org online program or download it. It is an open source program. With it you can drag and drop widgets.

The code generated:
<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<Button
android:id="@+id/widget28"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffccffcc"
android:text="Press Me"
android:textStyle="bold|italic"
android:layout_x="0px"
android:layout_y="126px"
>
</Button>
<TextView
android:id="@+id/widget30"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ff000000"
android:text="My First View"
android:layout_x="112px"
android:layout_y="95px"
>
</TextView>
</AbsoluteLayout>

No comments:

Post a Comment