简体   繁体   English

使用毕加索从服务器加载不同屏幕尺寸的图像吗?

[英]Load images for different screen sizes from the server using picasso?

Hello i am making an android app in which i am getting images from the server and for that i am using picasso library now my question is that as there are different densities of screens with different sizes including (ldpi, mdpi, hdpi, xhdpi )required for different devices now i want to know in background does picasso itself do something so that if i will open an high density pic on an small screen size mobile then it will not get blurred or something or hang my phone or anyway so that it can dynamically adjust the pic for respective devices. 您好,我正在制作一个Android应用程序,在该应用程序中,我正在从服务器中获取图像,为此,我正在使用Picasso库。我的问题是,由于存在具有不同尺寸(包括(ldpi,mdpi,hdpi,xhdpi))的不同密度的屏幕现在我想针对不同的设备在背景中知道毕加索本身是否会做某事,以便如果我将在小屏幕尺寸的手机上打开高密度图片,那么它不会变得模糊不清或挂东西或挂断手机,以便它可以动态调整相应设备的图片。 Can i use ninepatch images for resolving my query. 我可以使用ninepatch图像来解决我的查询吗?

Update - i have read answers that picasso itself handle all these densities problems but in my case what am i doing wrong because of what my recyclerview is hanging ?? 更新 -我已经阅读了答案,毕加索本身可以处理所有这些密度问题,但是在我的情况下,由于recyclerview挂了什么,我在做什么错了?

毕加索不知道要下载哪个图像,但是请检查Picasso.fit()每个文档将尝试哪个图像,以尝试调整图像的大小以完全适合目标{@link ImageView}的边界

ninepatch used for system elements images rather than pictures. ninepatch用于系统元素图像而不是图片。 You have not specified the image is part of the interface or content. 您尚未指定图像是界面或内容的一部分。

You can get the density of the screen and the resolution of software and stretch / compress the image. 您可以获取屏幕密度和软件的分辨率,并拉伸/压缩图像。 (I would in your place was not afraid of distortion and memory problems in the low devices) So what can you do multiple sets of graphics on the server, if so worried. (我会在您的位置不担心低端设备的失真和内存问题)如果担心的话,可以在服务器上做多套图形处理。

But most of all, you really will approach the solution of this response . 但最重要的是,您确实会找到此响应的解决方案。

But it's weird, to be honest. 但是,老实说,这很奇怪。 We need more information. 我们需要更多信息。 I normally use drawable-XXX, ninepatch for buttons (backgound panels...), and stretch / compress on RapidDecoder for content. 我通常使用drawable-XXX,ninepatch作为按钮(背景面板...),并在RapidDecoder上 stretch / compress内容。

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

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