如何在代码中设置imageview的大小
1个回答
展开全部
<span style="font-family:SimHei;font-size:18px;">ImageView imageView = (ImageView)findViewById(R.id.imageView);
imageView.setImageResource(R.drawable.newscar);
LayoutParams params = imageView.getLayoutParams();
params.height=200;
params.width =100;
imageView.setLayoutParams(params);
</span>
imageView.setImageResource(R.drawable.newscar);
LayoutParams params = imageView.getLayoutParams();
params.height=200;
params.width =100;
imageView.setLayoutParams(params);
</span>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询