setConstraintWidth

fun View.setConstraintWidth(width: Int?)

Sets the constraint width for the View inside a ConstraintLayout to the given width. If width is null, the width is set to ConstraintLayout.LayoutParams.MATCH_CONSTRAINT.

Throws

when the parent is not a ConstraintLayout.