我有一个ImageView
,它的高度和宽度都设置为fill_parent
,并且有一个相同值的LinearLayout
。因此,我认为这应该使我的图像适合屏幕大小。但是实际上只适合了80%(在横向模式下有顶部和底部边距)。
我尝试了以下代码但没有成功:
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
imgView.setMinimumWidth(width);
imgView.setMinimumHeight(height);
imgView.setMaxWidth(width);
imgView.setMaxHeight(height);
还有其他的想法吗?