![]() In most of your use cases, you want to prevent this from happening. Now, as with any image manipulation, resizing images can really distort the aspect ratio and uglify the image display. However, if you know how large the images should be, use override() to provide a specific size. For example, if the app wants to warm up the cache in the splash screen, it can't measure the ImageViews yet. This option might also be helpful when you load images when there is no target view with known dimension yet. override(600, 200) // resizes the image to these dimensions (in pixel). load(UsageExampleListViewAdapter.eatFoodyImages) This will resize the image before displaying it in the ImageView. With Glide, if the image should not be automatically fitted to the ImageView, call override(horizontalSize, verticalSize). ![]() Picasso has the same ability, but requires a call to fit(). Glide automatically limits the size of the image it holds in cache and memory to the ImageView dimensions. In comparison to Picasso, Glide is much more efficient memory-wise. Generally speaking, it's optimal if your server or API deliver the image in the exact dimensions you need, which are a perfect trade-off between bandwidth, memory consumption, and image quality.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |