android在java中动态改变控件大小

在java代码如下:

ImageButton exitbot =(ImageButton) findViewById(R.id.exit);ViewGroup.LayoutParams exitbotn = (ViewGroup.LayoutParams)exitbot.getLayoutParams();exitbotn.width = botwidth;exitbotn.height = botheight;