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
  • 65,094
  • 10
  • 126
  • 115
Luke
  • 465
  • 10
  • 27

1 Answers1

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

 view.setLayoutParams(lp);
Rajan Kali
  • 11,436
  • 3
  • 24
  • 35