Android Update Layout Height and Width Programatically with Android KTX

July 25, 2018
Update android:layout_height and android:layout_width
view.updateLayoutParams {
    height = 100
    width = LayoutParams.WRAP_CONTENT
}

NOTE: height is in pixel, refer to Convert Dp to Pixel.

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.