Skip to content

Instantly share code, notes, and snippets.

@AlexGabor
Created August 17, 2019 07:58
Show Gist options
  • Save AlexGabor/cb452dc0dfdf58d4c8e542518bef1fc8 to your computer and use it in GitHub Desktop.
Save AlexGabor/cb452dc0dfdf58d4c8e542518bef1fc8 to your computer and use it in GitHub Desktop.
ConstraintLayout header and list
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/header" />
</androidx.constraintlayout.widget.ConstraintLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment