3. 6.1 Constraint Layout
- Constraint layout is provided by an external library.
- It allows you to use a flat view hierarchy and has great performance.
- Also the design tools support constraint layout very well.
- New projects should prefer the usage of constraint layout.
Details: https://developer.android.com/reference/android/support/constraint/ConstraintLayout.html
4. 6.2 FrameLayout
• FrameLayout is designed to display a single item at a time.
• You can have multiple elements within a FrameLayout but each
element will be positioned based on the top left of the screen.
6. 6.3 LinearLayout
• Linear Layout is a common layout that arranges
“component” in vertical or horizontal order.
• Component is arrange via orientation attribute.
•For example
• FOR HORIZONTAL ARRANGEMENT
• android:orientation="horizontal“
• FOR VERTICAL ARRANGEMENT
• android:orientation=“vertical"
9. 6.4 RelativeLayout
• RelativeLayout let you position your component base on the
nearby (relative or sibling) component’s position.
• It’s the most flexible layout, that allow you to position your
component to display in anywhere you want.
• in Relative Layout, you can use “above, below, left and right” to
arrange the component position
11. 6.5 GridLayout
- GridLayout allows you to organize views into a grid / table. GridLayout
separates its drawing area into: rows, columns, and cells.
- You can specify how many columns the grid should have. For each view you
can specify in which row and column it should be placed and how many columns
and rows it should use. If not specified, GridLayout uses defaults, e.g., one
column, one row and the view position depends on the order of the declaration.
13. 6.6 ScrollView
The ScrollView or the
HorizontalScrollView class is useful to
make views available, even if they do not fit
onto the screen. A scroll view can contain
one view, e.g., a layout manager containing
more views. If the child view is too large,
scroll view allows scrolling the content.
15. 6.7 TableLayout
• TableLayout organizes content into rows and columns.
• The rows are defined in the layout XML, and the columns are determined automatically
by Android.
• This is done by creating at least one column for each element.
• You can specify that an element should occupy more than one column using
android:layout_span.