I believe I have had similar issues in the past ever since v3.x and they keep coming. I don't know how many hours I have to spend on trying to use the layout editor and they just can't get it right.
Anyway, here is the xml code:
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="TextView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
Here is how it looks:
Any item I drag in gets put in the top left corner with 0 size. No matter if you set exact sizes or just constraints.
My Android Studio version is 3.4.1
Using 28.0.0 support libs.
I cannot downgrade due to company policy, so that's not an option.
Constraint Layout version is the latest:
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
It did not work with earlier versions either.
I have tried several things which "worked" earlier with other similar bugs:
Any suggestion is welcome
Just cleaning the project worked for me.
So basically the issue was completely elsewhere in another layout file, nothing to do with constraint layout. Anyway after a clean and build AND restart it eventually worked!
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