我有一个imageview
,它的高度和宽度设置为fill_parent
,其中linearlayout
具有相同的值集。所以我想这应该设置我的图像适合屏幕。但它只适合80%(在横向模式下保证金顶部和底部)。android:在imageview中将图像拉伸为适合屏幕
我已经尝试没有成功下面的代码:
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
imgView.setMinimumWidth(width);
imgView.setMinimumHeight(height);
imgView.setMaxWidth(width);
imgView.setMaxHeight(height);
任何其他的想法?
虽然这是一个稍微不同的问题,你必须指定
android:layout_width="75dp"
和android:layout_height="75dp"
,[这个答案](http://stackoverflow.com/questions/2991110/android-how-to-stretch-an-image-to-the-screen-width-while-maintaining-aspect-rat/2999707#2999707)应该可以帮到你。 – fredley 2011-01-12 11:51:56