另一种解决方案: imageView.setAdjustViewBounds(true); imageView.setBaselineAlignBottom(true); 适用于 API_LEVEL >= 11。
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); iv.setMargins(left, top, right, bottom); imageView.setLayoutParams(lp);
? - g00dy