0

in my xml-code I set in every View a weight value.

Now i need to change run-time the value in my java code. I found only the setWeightSum function. There is a function to set the layout_weight?

Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
Luke
  • 517
  • 10
  • 29

1 Answers1

1
LinearLayout.LayoutParams lp= new LinearLayout.LayoutParams(
                             LayoutParams.MATCH_PARENT,
                             LayoutParams.MATCH_PARENT, layout_weight);

 view.setLayoutParams(lp);
Rajan Kali
  • 12,627
  • 3
  • 25
  • 37