core-ktx / androidx.view / android.view.ViewGroup / updateLayoutParams

updateLayoutParams

inline fun ViewGroup.updateLayoutParams(block: LayoutParams.() -> Unit): Unit

Executes block with the ViewGroup's layoutParams and reassigns the layoutParams with the updated version.

See Also

ViewGroup.getLayoutParams

ViewGroup.setLayoutParams

@JvmName("updateLayoutParamsTyped") inline fun <reified T : LayoutParams> ViewGroup.updateLayoutParams(block: T.() -> Unit): Unit

Executes block with a typed version of the ViewGroup's layoutParams and reassigns the layoutParams with the updated version.

See Also

ViewGroup.getLayoutParams

ViewGroup.setLayoutParams