dimsuz
06/10/2020, 4:47 PMContourLayout
question. Can I somehow achive the following: child view is laid out using wrap_content
if it has width < parent.width()
but otherwise it stays at parent.width()
.
In short I want center_horizontally + width=min(width, parent.width())
.
ConstraintLayout
has some magic flags for this (layout_width=0dp + constrainedWidth + constraintWidthDefault=wrap).
I tried leftTo { parent.left() }.rightTo(sizeMode = AtMost) { parent.right() }
but this does not center the view, altough it does forbid it to grow beyond parent.
@saket lightest ping :)