Layout XML Code (Cont.)

android:layout_weight = "0.07"
The android:layout_weight assigns an “importance” value to a view in terms of how much space it should occupy on the screen. A larger weight value allows it to expand to fill any remaining space in the parent view.

android:weightSum="1"
Defines the maximum weight sum. If unspecified, the sum is computed by adding the layout_weight of all of the children.

android:gravity="center"
This attribute specifies how to place the content of an object, both on the x- and y-axis, within the object itself. The value center places the object in the center of its container in both the vertical and horizontal axis, not changing its size.

android:textAppearance = "?android:attr/textAppearanceLarge"
This corresponds to the global attribute resource symbol textAppearance, which specifies base text color, typeface, size, and style. Must be a reference to another resource, in the form
   @[+][package:]type:name
such as @android:color/black or to a theme attribute in the form
   ?[package:][type:]name
such as ?android:attr/textColorPrimary.
HelloWorld/app/src/main/res/layout/activity_main.xml
01<LinearLayout
02  xmlns:android            = "http://schemas.android.com/apk/res/android"
03  android:orientation      = "vertical"
04  android:layout_width     = "fill_parent"
05  android:layout_height    = "fill_parent"
06  android:weightSum        = "1"
07  android:gravity          = "center">
08  <TextView
09    android:layout_width   = "wrap_content"
10    android:layout_height  = "wrap_content"
11    android:textAppearance = "?android:attr/textAppearanceLarge"
12    android:text           = "Hello, your name:"
13    android:layout_weight  = "0.07"
14    android:textStyle      = "bold" />
15  <EditText
16    android:layout_width   = "216dp"
17    android:layout_height  = "wrap_content"
18    android:id             = "@+id/name" />
19  <Button
20    android:layout_width   = "wrap_content"
21    android:layout_height  = "wrap_content"
22    android:text           = "@string/next_page"
23    android:id             = "@+id/next" />
24</LinearLayout>