简体   繁体   English

如何在ImageView中设置图像而不在android中全屏显示

[英]how to set the Image in ImageView without strected with full screen in android

I am using imageview to show the photo.我正在使用 imageview 来显示照片。 And i am showing photo in full screen.我正在全屏显示照片。 then my photo is streched.然后我的照片被拉伸了。 and my imageview height is 500 and width is 300 .How to solve this task.我的 imageview 高度是 500 ,宽度是 300 。如何解决这个任务。

Try changing the scaleType of the image view.尝试更改图像视图的scaleType

In xml, android:scaleType="centerInside"在xml中, android:scaleType="centerInside"

If center inside isn't what you want, see the other options at this link如果 center inside 不是您想要的,请参阅此链接中的其他选项

https://thoughtbot.com/blog/android-imageview-scaletype-a-visual-guide https://thoughtbot.com/blog/android-imageview-scaletype-a-visual-guide

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

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