Spacing between controls inside LinearLayout

By shaikhmo
In November 18, 2015
570 Views

Kind of hack to add spacing between controls or elements inside a LinearLayout.

I had a requirement where the container was a LinearLayout, and I had to place two ImageButton’s to the extremes,

i.e first button to extreme left and the second button to the extreme right

 

To achieve this, I’ve added a View with weight as 1 between the two ImageButton.

 

 

 

Another example of doing so is

 

Leave A Comment