[英]Expand image on layout manager of Android studio
I have picture like this, ImageView
size is the same as the image size with wrap_content option
. 我有这样的图片,
ImageView
的大小与带有wrap_content option
的图像大小相同。
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
app:srcCompat="@drawable/backnormal" />
Then I drag the edge of the imageView
, only imageView
is expanded and wrap_content
is changed automatically like ( wrap_content -> 300dp ) 然后我拖动的边缘
imageView
,只有imageView
膨胀和wrap_content
就像自动改变(WRAP_CONTENT - > 300dp)
I would like to expand the image itself and not only imageView
. 我想扩展图像本身,而不仅仅是
imageView
。 Is it possible?? 可能吗??
You can use android:scaleType="centerCrop"
attribute. 您可以使用
android:scaleType="centerCrop"
属性。 There are also other values for this attribute. 此属性还有其他值。
Learn more here: https://developer.android.com/reference/android/widget/ImageView.ScaleType.html 在此处了解更多信息: https : //developer.android.com/reference/android/widget/ImageView.ScaleType.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.