【发布时间】:2011-06-30 14:32:49
【问题描述】:
应该是一个简单的。
当我拉image.getDrawable().getIntrinsicWidth() 时,我得到一个大于源图像宽度的值。它的 X 坐标返回 2880 而不是 1920 1.5 倍大?
我想知道具有“中心”的 scaleType 的 ImageView 是否会影响它,但是,根据documentation:
"将图像在视图中居中,但不执行缩放。"
这里是来源:
<ImageView
android:id="@+id/backgroundImage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/background"
android:scaleType="center"/>
【问题讨论】:
-
你在
ImageView中使用wrap_content吗? -
是的,我的
ImageView的高度和宽度都有wrap_content。