make RecyclerView’s height to “wrap_content” in Constraint layout

i had the same issue and i find this solution: you should add this attribute to your recyclerview and it makes your recyclerview wrap_content in the constraint_layout: app:layout_constraintHeight_default=”wrap” let me know if this solution fixed your problem. EDIT : recycler’s height should be 0dp. EDIT 2 : in the newer versions of support library, use … Read more

Chain with a barrier in ConstraintLayout

I know it’s old but i think to do that without nesting, you have to change top component to something like this. android:layout_height=”wrap_content” android:layout_gravity=”center” <androidx.constraintlayout.widget.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:layout_gravity=”center” xmlns:tools=”http://schemas.android.com/tools” xmlns:app=”http://schemas.android.com/apk/res-auto”>

Can’t form a chain between two views/widgets in Android Studio

I was trying to figure this out too. I’ve discovered that one way to do it is to select both views, then right click and select Center Horizontally. This creates the chain, but then you have to adjust any other constraints accordingly. I’m new to Android, so I’m sure there will be other ways….

How to make view “wrap_content but not larger than” with ConstraintLayout?

Title and version should be in the chain and app:layout_constraintWidth_default=”wrap” used: <?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=”horizontal” android:layout_width=”match_parent” android:layout_height=”wrap_content” tools:background=”#b3b2b2″> <!– information button –> <ImageView android:id=”@+id/LibraryWithVersionItem.info” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:paddingTop=”@dimen/margin8″ android:paddingLeft=”@dimen/margin8″ android:paddingRight=”@dimen/margin8″ android:paddingBottom=”@dimen/margin8″ android:scaleType=”center” android:src=”https://stackoverflow.com/questions/44099951/@drawable/ic_info_outline_white_24dp” app:layout_constraintRight_toRightOf=”parent” app:layout_constraintTop_toTopOf=”parent”/> <!– –> <TextView android:id=”@+id/LibraryWithVersionItem.title” android:layout_width=”0dp” android:layout_height=”wrap_content” android:layout_marginTop=”8dp” android:ellipsize=”middle” android:textColor=”@color/mySecondaryDarkColor” android:textSize=”@dimen/fontSize18″ android:textStyle=”bold” app:layout_constraintLeft_toLeftOf=”parent” app:layout_constraintTop_toTopOf=”parent” app:layout_constraintWidth_default=”wrap” tools:text=”ExampleLibrary 01234567890123456789012345″ app:layout_constraintRight_toLeftOf=”@+id/LibraryWithVersionItem.versions” … Read more