嗨,我想在我的活动中更改图像视图的高度和宽度属性,我按以下方式尝试了它,但它对我不起作用......
View card_view = getLayoutInflater().inflate(R.layout.card_details1,null);
coupon_img = (ImageView) card_view.findViewById(R.id.coupon_image);
// I tried this ////////
coupon_img.getLayoutParams().height = 20;
coupon_img.getLayoutParams().width = 20;
// I also tried this ////
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(100, 100);
coupon_img.setLayoutParams(layoutParams);
// also this one ////
coupon_img.setMaxHeight(10);
但我无法更改 imageview src 的高度和宽度。我做错了什么吗?这该怎么做?需要帮助...谢谢...