setLayoutMarginVertical

fun View.setLayoutMarginVertical(margin: Int?)

Sets the ViewGroup.MarginLayoutParams.topMargin and ViewGroup.MarginLayoutParams.bottomMargin of the View to the given margin. If margin is null, the top and bottom margins are set to 0.