ConstraintLayout: placing an element outside the layout.

Placing an element outside of the layout using percentage dimensions.

Placing an element outside of the layout.

XML.

Key point: to use percentages, you must use ConstraintLayout.
To place an element outside the layout, you need to set layout_width and layout_height as 0 and layout_constraintWidth_percent as 0.999, just like that, 1 will not work.

And depending on which side of the markup you need to place the element, use:

LEFT -> layout_constraintEnd_toStartOf.

RIGHT -> layout_constraintStart_toEndOf.

TOP -> layout_constraintBottom_toTopOf.

BOTTOM -> layout_constraintTop_toBottomOf.

The element placed to the left of the markup.

Feedback.

--

--