# Intro to the new ConstraintLayout in Android

DevFeed: [Intro to the new ConstraintLayout in Android](<https://devfeed.tech/articles/intro-to-the-new-constraintlayout-in-android-25833.md>)

Original publisher: [Read original article](<https://segunfamisa.com/posts/constraint-layout-in-android>)

Author: Segun Famisa

Published: 2016-05-30T11:05:30Z

Content type: tutorial

Language: en

Sources: [Segun Famisa](<https://devfeed.tech/sources/segun-famisa.md>)

Topics: [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [Android](<https://devfeed.tech/topics/android.md>), [ui](<https://devfeed.tech/topics/ui.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [constraintlayout](<https://devfeed.tech/tags/constraintlayout.md>), [guide](<https://devfeed.tech/tags/guide.md>), [layout](<https://devfeed.tech/tags/layout.md>), [ui](<https://devfeed.tech/tags/ui.md>)

## AI overview

This tutorial introduces Android's ConstraintLayout and the associated layout editor in Android Studio 2.2 Preview. It explains how constraints position views relative to other views, layout edges, or guidelines, and describes resize, side, and baseline handles. It also outlines setup requirements and initial ways to create a ConstraintLayout.

## Source excerpt

Last week, also during the Google I/O conference, Google introduced a new set of tools for Android developers. Among them is a new Layout editor and a new layout called the ConstraintLayout. The ConstraintLayout was said to be a new tool to empower developers create very flat ui-hierarchies for their complex layout. I've been playing around and exploring the new thing and I'll summarize my findings in this post. To be able to access these new features, you need to be running Android Studio 2.2 Preview and Java 8. You can head over to the canary channel to download it. Be sure to run it in parallel with your stable version. It's still in Preview! Layout Editor & Constraints Overview. The new layout editor in Android Studio 2.2 Preview is specially built for the ConstraintLayout. You can specify the constraints manually, or automatically reference within the layout editor. Overview of Constraints? A constraint is the description of how a view should be positioned relative to other items, in a layout. A constraint is typically defined for one or more sides by connecting the view to: An anchor point, or another view, An edge of the layout, Or An invisible guide line. Since each view within the layout is defined by associations to other views within the layout, it's easier to achieve flat hierarchy for complex layouts. In principle, the ConstraintLayout works very similar to the RelativeLayout, but uses various handles (or say anchors) for the constraints. (Source) Resize handle. The resize handle is the seen in the corners of the figure above, and it's used to resize the view. Side handle. The side handle is the in the figure above, and it's used to specify the location of a widget. E.g using the left side handle to always be aligned to the right of another view, or the left of the ConstraintLayout itself. Baseline handle. The baseline handle is the in the figure above. It is used to align the text of a view by the baseline of the text on another view. Getting started w