Saturday, 26 January 2013

Layout XML Code



The layout file specifies the layout of your screen. In this case, shown in Example 3-2,we have only one screen, and it’s loaded by the HelloWorld.java code seen in Exam-ple 3-5.
Example 3-2. res/layout/main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TextView android:layout_width="fill_parent"
                android:layout_height="wrap_content" android:text="@string/hello" />
</LinearLayout>

No comments:

Post a Comment