简体   繁体   English

Android Studio:缩放 ImageView 边界以适合图像

[英]Android Studio: Scale ImageView Boundary to fit within Image

I want to scale the borders to fit the image.我想缩放边框以适合图像。 In my file explorer, the image is small and has fit, But hasn't fit in android Studio在我的文件资源管理器中,图像很小并且适合,但不适合 android Studio

这是我的形象。

If I scale the width and height to a specific value, the whole image shrinks:如果我将宽度和高度缩放到特定值,整个图像会缩小:

Like this像这样

Edit: I got it by changing the scaleX and scaleY编辑:我通过更改 scaleX 和 scaleY 得到它

the empty space around image exist in your image, so edit your image and make sure that you crop the image so it just contain what you want.图像周围的空白区域存在于您的图像中,因此编辑您的图像并确保裁剪图像以使其仅包含您想要的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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