Adding ConstraintLayout to your project

suggest change

To work with ConstraintLayout, you need Android Studio 2.2 or newer and version 32 or higher of the Android Support Repository.

  1. Add the Constraint Layout library as a dependency in your build.gradle file:
dependencies {
   compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
  1. Sync project

To add a new constraint layout to your project:

  1. Right-click your module’s layout directory, then click New > XML > Layout XML.
  2. Enter a name for the layout and enter android.support.constraint.ConstraintLayout for the root tag.
  3. Click Finish.

Or add it to a layout file directly:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</android.support.constraint.ConstraintLayout>

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents