setLayoutWidth

fun View.setLayoutWidth(layoutWidthPx: Int?)

Sets the ViewGroup.LayoutParams.width of the View inside a ViewGroup to the given layoutWidthPx. If layoutWidthPx is null, the layout width is set to 0.

Throws

when the view has a different type of layout as parent.


fun View.setLayoutWidth(layoutWidthPx: Float?)

Sets the ViewGroup.LayoutParams.width of the View inside a ViewGroup to the given layoutWidthPx. The fractional part, if any, is rounded down towards zero. If layoutWidthPx is null, the layout width is set to 0.

Throws

when the view has a different type of layout as parent.