【发布时间】:2011-06-07 18:26:53
【问题描述】:
我有一个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);
还有其他想法吗?
【问题讨论】:
-
虽然这是一个稍微不同的问题,this answer 应该可以帮助你。