【发布时间】:2023-03-18 08:23:01
【问题描述】:
在我的应用程序中单击按钮时,我想更改 imageview 的大小。当我单击一个按钮时,我想将 imageview 的大小增加 5(每个宽度和高度)。单击其他按钮时,我想减小大小。我试过这个。 我该怎么做?下面是代码。它不起作用
public void increase(View v)
{
int height=imageView.getHeight();
int width=imageView.getWidth();
imageView.getLayoutParams().height = height+5;
int h=imageView.getHeight();
System.out.println("hhhhhhhhhh,,,,,,,,,,"+h);
System.out.println("width n hight..."+width+"and"+height);
}
【问题讨论】:
标签: android layout height imageview width