Using a placeholder image before uploading a full image

What is the correct way to use a placeholder image?

I want to populate the UIScrollView with images as a subview, but it was hard to load all the full images before the old devices before showing the scroll.

How can I use a placeholder image so that I can download the whole image when the user scrolls to this content?

I tried using the ALAsset thumbnail, but the scaling looks awful.

+3
source share
1 answer

Suppose you are using UIImageView subselects for your image fragments. First, you can populate your UIImageView routines as follows:

 for each tile location in myScrollView area:
    [myScrollView addSubview:[UIImageView 
       initWithImage:[UIImage imageNamed:@"placeholder.png"]]];

, imageNamed (. SDK), placeholder.png .

UIScrollView, , , UIImageView ( , ).

, - , .

+2

Source: https://habr.com/ru/post/1795434/


All Articles