Layout controls determine how and where on the screen child controls are drawn

Layout controls determine how and where on the screen

This preview shows page 7 - 14 out of 99 pages.

Layout controls determine how and where on the screen child controls are drawn. Each type of layout control draws its children using particular rules. For instance, the LinearLayout control draws its child controls in a single horizontal row or a single vertical column. Similarly, a TableLayout control displays each child control in tabular format (in cells within specific rows and columns).
Image of page 7

Subscribe to view the full document.

Displaying Text to Users with TextView One of the most basic user interface elements, or controls, in the Android SDK is the TextView control. You primarily use it to display fixed text strings or labels. The TextView control is a child control within other screen elements and controls. As with most of the user interface elements, it is derived from View and is within the android.widget package. Because it is a View , all the standard attributes such as width, height, padding, and visibility can be applied to the object.
Image of page 8
Displaying Text to Users with TextView (Cont’d) However, because this is a text-displaying control, you can apply many other TextView attributes to control behavior and how the text is viewed in a variety of situations. <TextView> is the XML layout file tag used to display text on the screen. You can set the android:text property of the TextView to be either a raw text string in the layout file or a reference to a string resource.
Image of page 9

Subscribe to view the full document.