简体   繁体   中英

iOS - Size of Image vs. Size of ImageView

just want to see if I'm on the right track here is understanding the performance trade-offs of placing various image sizes into image views.

If I have a large image, will the image load faster if I place it in a correspondingly large imageView versus placing it in a smaller imageView?

No, the loading time depends on the file, and if the image is large, and its file Size is large, it will load slower than a small images on the same image View. To make it clear, image view doesn't affect loading performance, image size (File size) does affect performance.

Answering you r question first, size of image is not directly proportional to imageview ie regardless of your imageview size, you image will take time based on the size of image.

Now, if you have a task in which you need to show user images & on click you need to share that image, you need to maintain 2 copies for showing take resized copy & while sharing pick image from original position. In this way, your loading will be fast & while sharing you will be able to share original image itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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