can't create a ConstraintLayout

android android-constraintlayout

222 观看

1回复

0 作者的声誉

I'm trying to make some changes on a project I'm working on, and one of them is changing some layouts from RelativeLayout to ConstraintLayout, the thing is that when I replace "RelativeLayout" with "android.support.constraint.ConstraintLayout" or even when I try to create a new XML layout file using "android.support.constraint.ConstraintLayout" android studio doesn't recognize it at all!!

anyhelp? enter image description here

enter image description here

作者: user6534005 的来源 发布者: 2017 年 12 月 27 日

回应 1


0

2249 作者的声誉

决定

Add this dependency in build.gradle file

implementation 'com.android.support.constraint:constraint-layout:1.0.2'

And If you haven't migrated to gradle 4, use compile instead of implementation.

compile 'com.android.support.constraint:constraint-layout:1.0.2'
作者: Munir 发布者: 2017 年 12 月 27 日
32x32