Skip to content

Instantly share code, notes, and snippets.

@christianb
Created July 24, 2020 14:57
Show Gist options
  • Save christianb/fea96b4774009cf94158e55f4f334378 to your computer and use it in GitHub Desktop.
Save christianb/fea96b4774009cf94158e55f4f334378 to your computer and use it in GitHub Desktop.
Contraint a View Min Max within ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintWidth_min="10dp"
app:layout_constraintWidth_max="30dp"
app:layout_constraintHeight_min="10dp"
app:layout_constraintHeight_max="30dp"
app:layout_constrainedWidth="true"
app:layout_constrainedHeight="true" />
</androidx.constraintlayout.widget.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment