tags:

views:

47

answers:

2

friends,

i want to set layout_marginBottom using java code or dynamically

in list view or linearlayout

any one guide me how to achieve this?

any help would be appreciated.

A: 

You can use setMargins. Look at official documentation:

http://developer.android.com/reference/android/view/ViewGroup.MarginLayoutParams.html#setMargins(int,%20int,%20int,%20int)

Ger

ggomeze
A: 
ListView lst=getListView();

LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
                params.setMargins(0, 0, 0, 0);
                //left,top,right,bottom
                lst.setLayoutParams(params);
UMMA