您好
有没有办法实现这个目标:
......而不是:
(图像和屏幕边框之间的边距很小)
我使用过这些代码,但它们无效:
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
myImg.setMinimumWidth(width);
myImg.setMinimumHeight(height);
myImg.setMaxWidth(width);
myImg.setMaxHeight(height);
和此:
myImg.setScaleType(ScaleType.FIT_XY);
答案 0 :(得分:3)
我假设您正在使用标准活动。
你有可能有一个带有填充的relativelayout或linearlayout作为你的视图组吗?
答案 1 :(得分:1)
您可以在xml中使用scaletype fitxy来解决该问题。