Search code examples
androidandroid-layoutandroid-coordinatorlayoutandroid-constraintlayout

Using coordinatorLayout anchor's with constraintLayout


I want to design something like this :

enter image description here

as you can see fab is between header and the body.

it's easy to do it with coordinatorLayout with app:anchor and app:anchorGravity attributes

but i want to do it with constraintLayout.

any ideas ?


Solution

  • I've found the answer :))

    <FAB
       ...
       app:layout_constraintTop_toBottomOf="@+id/header"
       app:layout_constraintBottom_toTopOf="@id/body"/>