Skip to content Skip to sidebar Skip to footer

Android: Retrieve Layout_marginBottom Programmatically?

In my a LinearLayout I have set android:layout_marginBottom in my XML. I just want to retrieve that value. Just LayoutParams doesn't give me access to bottomMargin . I tried to ty

Solution 1:

Change Your layout of Button according to following logic,

set Layout_Width to 0dip set Layout_Weight to 1 set Layout_Height to Wrap_Content


Solution 2:

try this. When you get layout, R.layout. is best option. It is working for me.

  row1 = (LinearLayout) findViewById(R.layout.mainrow1); 

Post a Comment for "Android: Retrieve Layout_marginBottom Programmatically?"