【发布时间】:2012-12-18 02:42:29
【问题描述】:
我的ImageView 是否有可能适合所有屏幕尺寸而不会拉伸图像?
我尝试使用 fill_parent > wrap_content 将其更改为背景和 src 的所有比例类型
但仍然。如果图像不小,它看起来只是被拉伸了..
示例:
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:adjustViewBounds="true"
android:background="@drawable/background" />
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:background="@drawable/background" />
这 2 个适合宽度,但图像被拉伸.. 但是当我将其更改为 src 时,图像只是居中且很小。
【问题讨论】:
-
您要求的东西显然是不可能的。当然,除非您想要填充的图像和屏幕/视图恰好具有相同的纵横比。
标签: android android-layout uiimageview imageview