Info

android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" />

<Button android:id="@+id/b1"

android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@+string/hello" />

</LinearLayout>

The layout file in Listing 3-2 defines a root node called LinearLayout, which contains a TextView followed by a Button. A LinearLayout lays out its children vertically or horizontally— vertically, in this example.

You will need to define a separate layout file for each screen. More accurately, each layout needs a dedicated file. If you are painting two screens, you will likely need two layout files such as/res/layout/screen1_layout.xml and /res/layout/screen2_layout.xml.

0 0

Post a comment