I am programatically adding custom views to a vertical LinearLayout, and I would like there to be some space between the views. I have tried adding: setPadding(0, 1, 0, 1)
Use LinearLayout.LayoutParams instead of MarginLayoutParams. Here's the documentation.
LinearLayout.LayoutParams
MarginLayoutParams