From the course: Android Development Essential Training: 2 User Interface Design

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Distribute views with constraint chains

Distribute views with constraint chains - Android Tutorial

From the course: Android Development Essential Training: 2 User Interface Design

Start my 1-month free trial

Distribute views with constraint chains

- [Instructor] ConstraintLayout has a feature called chains that allow you to control the space between views. We'll start with an empty ConstraintLayout and then we're going to add in three random buttons. We can grab those right from the palette. So one, two, and three. Let's close down these dialogs. And now with our three buttons added, let's quickly change their text to Button 1, 2 and 3 respectively. So I'll choose the first button and then we'll come down to underneath the Common Attributes and we'll change this to Button 1. We'll select the second button, and we'll change it to Button 2. And then finally, the third button, we'll name Button 3. That'll just make it easier for us later when we're inspecting these elements. So for now, let's close the attributes and increase the zoom. Perfect. To get started with our chain, we'll choose the first button and we'll constrain its left and top to the parent…

Contents