I'm using androidx.constraintlayout.widget.ConstraintLayout in my layout and it does not show the chains, also I can't drag any widgets. I just type the constraints that I want to use.
<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="112dp"/>
here's a sample screen shot for androidx constraintLayout: androidx.constraintlayout.widget.ConstraintLayout
but when I tried switching back to : android.support.constraint.ConstraintLayout it i can see it
<android.support.constraint.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="112dp"/>
here's a sample screen shot for support constraintLayout: android.support.constraint.ConstraintLayout
is this a bug or something?
my current solution is to switch from:
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
to
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
but this does not solve my problem cause I don't want to use support.
A ConstraintLayout is a ViewGroup which allows you to position and size widgets in a flexible way. Note: ConstraintLayout is available as a support library that you can use on Android systems starting with API level 9 (Gingerbread).
In Grid Layout, the UI which is actually seen in the Design editor of Android Studio will be the same as that we will get to see in the app, but in the case of Constraint layout if the UI component is not Constrained then the UI will not look same as that of in design editor.
A MotionLayout is a subclass of ConstraintLayout which supports transitions between between various states ( ConstraintSet ) defined in MotionScene s. A ConstraintLayout is a ViewGroup which allows you to position and size widgets in a flexible way.
A Barrier references multiple widgets as input, and creates a virtual guideline based on the most extreme widget on the specified side. A ConstraintLayout is a ViewGroup which allows you to position and size widgets in a flexible way.
I had the same problem until I realized that I should use the Canary version to solve it. after installing Canary version beside stable version, open the project and now you can use this implementation:
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
instead of
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
Keep in mind that you may need to do the following:
My problem solved with this method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With