You are on page 1of 30

Lesson Objectives:

• View Groups
• LinearLayout
• RelativeLayout
• Examples and Demo
• Exercises
View Groups

A ViewGroup is a special
view that can contain other
views (called children.) The
view group is the base class
for layouts and views
containers.
• Root View
• Parent
• Child
• Sibling
View Groups
View Groups
Exercise
Types of ViewGroups
Types of ViewGroups
Types of ViewGroups
Types of ViewGroups
Types of ViewGroups
Types of ViewGroups
ViewGroups Demo
HOME
Activity

EXERCISE 1
https://labs.udacity.com/android-visualizer/#/android/linear-layout
HOME
Activity

EXERCISE 2
https://labs.udacity.com/android-visualizer/#/android/linear-layout
Widths on Child View
Heights on Child View
HOME
Activity

EXERCISE 3 (Android Layout Weight)


https://labs.udacity.com/android-visualizer/#/android/linear-layout
Note: Change layout_weight for Tim=“8” and explain what happen?
Linear Layout Weight
Example 1
Example 2
Example 3
HOME
Activity

EXERCISE 4 (Android Layout Weight)


https://labs.udacity.com/android-visualizer/#/android/linear-layout-weight
Relative Layout
Relative Layout
Relative Layout
Relative Layout
Relative Layout

Note: layout_centerHorizontal=“true”, layout_centerVertical=“true”


HOME
Activity

EXERCISE 5 (Relative Layout)


https://labs.udacity.com/android-visualizer/#/android/relative-layout-align-to-parent
https://labs.udacity.com/android-visualizer/#/android/relative-layout-view-ids

You might also like