I am dynamically adding linearlayouts to a main linearlayout which is contained in a scrollview. Scrollview --> MainLinearLayout --> Childrens.
Now i wanted some space between childrens so i i did the following :
RelativeLayout.LayoutParams lp=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,height_layout);
lp.setMargins(50,50,50,50);
linearLayout.setLayoutParams(lp);
But i am unable to see any space between the childrens they all are stuck with each other.
Height width works fine but not the margins.