简体   繁体   English

在Android Studio的布局管理器上展开图像

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM