0

我试图LinearLayout在应用程序运行期间动态更改高度的高度,但我总是得到一个NullPointerException. 我尝试了处理程序:

LinearLayout.LayoutParams parms = new linearLayout.LayoutParams(width,height);

我还尝试更改布局颜色并得到相同的错误。任何想法?

谢谢

4

1 回答 1

0

尝试这个:

LinearLayout.LayoutParams layoutparams = new LinearLayout.LayoutParams(100,100); 
linearLayout.setLayoutParams(layoutparams);
于 2013-03-05T23:34:18.473 回答