问题
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. Can i use ninepatch images for resolving my query.
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 ??
回答1:
Picasso won't know which image to download but check out Picasso.fit() which per the doc will Attempt to resize the image to fit exactly into the target {@link ImageView}'s bounds
回答2:
ninepatch used for system elements images rather than pictures. 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.
来源:https://stackoverflow.com/questions/33179102/load-images-for-different-screen-sizes-from-the-server-using-picasso