scaling image size in Picasso

大兔子大兔子 提交于 2019-12-04 09:35:18

Breaking the first part down in to two sections:

I want the image to display in it's original aspect ratio

To do this you can call .fit().centerInside() on the Picasso request

scaled to be a reasonable size - ie 75% of the screen width

The easiest way to do this would be to specify this in your layout, so set an ImageView to be this width. Then when Picasso loads the image into this ImageView it will automatically scale it to fit (but keeping the aspect ratio as specified above).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!