From the course: Android Development Essential Training: 2 User Interface Design
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Manage positions with constraints - Android Tutorial
From the course: Android Development Essential Training: 2 User Interface Design
Manage positions with constraints
- [Instructor] Constraint layout is the latest way to define complex layouts that avoid nested view hierarchies. It does this by means of constraints, that define how child views are laid out relative to each other, and the parent. To define the views position and constraint layout, you must add at least one horizontal and one vertical constraint. Each constraint defines the views position, along either the vertical or horizontal axis. So, each view must have a minimum of one constraint for each axis. The circles in the middle of each edge are the constraint handles. These are used to create constraints. The constraint handles are all empty in this image, which indicates that no constraint has been defined for them. But once constraints are defined, the constraint handles will become filled, as you see here in the after image. Although you mostly work with constraint layout in the visual editor, it's helpful to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Position views with LinearLayout4m 44s
-
(Locked)
Manage positions with constraints4m 52s
-
(Locked)
Distribute views with constraint chains4m 37s
-
(Locked)
Display views programmatically5m 20s
-
(Locked)
Get view references with findViewById()2m 34s
-
(Locked)
Get view references with view binding5m 35s
-
(Locked)
Challenge: Get in line50s
-
(Locked)
Solution: Get in line3m 33s
-
-
-
-
-