The View class represents the basic building block for user interface components.
View is the base class for widgets, which are used to create interactive UI components (buttons, text fields, etc.).
All of the views in a window are arranged in a single tree.
To arrange the views in one window we use different types of Layouts like :
- Linear Layout: A LinearLayout is a GroupView that will lay child View elements vertically or horizontally.
- Relative Layout: A RelativeLayout is a ViewGroup that allows you to layout child elements in positions relative to the parent or siblings elements.
- Table Layout: A TableLayout is a ViewGroup that will lay child View elements into rows and columns.
A brief sample of UI components:
Time / Date picker:
A DatePicker is a widget that allows the user to select a month, day and year. And a TimePicker is a widget that allows the user to select an hour, minute and second.
An XML-based layout is a specification of the various UIcomponents (widgets) and the relationships to each other – and to
their containers – all written in XML format.
Android considers XML-based layouts to be resources, and as such layout files are stored in the res/layout directory inside your Android project.
If a Button element has an attribute value of
android:textStyle = “bold”
that means that the text appearing on the face of the button should be rendered in a boldface font style.