您好我想改變我的活動 內線高度和圖像視圖的width屬性我試圖在下面的方式,但它不是爲我工作...如何設置ImageView的高度和寬度活動的Android
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的高度和寬度。我在做什麼錯誤? 如何做到這一點? 需要幫助... 謝謝...
使用縮放類型將圖像src合併到imageView – 2013-02-21 06:18:19