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.
layout_weight
of all of the children.
center
places the object in the center of its container in both the vertical and horizontal axis, not changing its size.
textAppearance
, which specifies base text color, typeface, size, and style.
Must be a reference to another resource, in the form
@[+][package:]type:namesuch as
@android:color/black
or to a theme attribute in the form
?[package:][type:]namesuch as
?android:attr/textColorPrimary
.
|
|
<LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:orientation = "vertical" android:layout_width = "fill_parent" android:layout_height = "fill_parent" android:weightSum = "1" android:gravity = "center"> <TextView android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:textAppearance = "?android:attr/textAppearanceLarge" android:text = "Hello, your name:" android:layout_weight = "0.07" android:textStyle = "bold" /> <EditText android:layout_width = "216dp" android:layout_height = "wrap_content" android:id = "@+id/name" /> <Button android:layout_width = "wrap_content" android:layout_height = "wrap_content" android:text = "@string/next_page" android:id = "@+id/next" /> </LinearLayout> |
I’m not in this world to live up to your expectations and you’re not in this world to live up to mine. ― Bruce Lee |