Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I add a fade in effect? #533

Closed
Ricardo1980 opened this issue Oct 23, 2013 · 6 comments
Closed

How can I add a fade in effect? #533

Ricardo1980 opened this issue Oct 23, 2013 · 6 comments

Comments

@Ricardo1980
Copy link

Hello!
How can I add a fade in effect when the image is retrieved?
BTW, the sample project does not work, it seems

import "webp/decode.h"

is missing in
UIImage+WebP.h
and vender/libwebp folder is empty.
I donwloaded the project as a ZIP file right now.
Thanks.

@asuralyc
Copy link

use completed block

[photoImgeView setImageWithURL:[NSURL URLWithString:photoPath] 
    completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
        if (cacheType == SDImageCacheTypeNone) {
            photoImgeView.alpha = 0;
            [UIView animateWithDuration:0.3 animations:^{
                photoImgeView.alpha = 1;
            }];
        } else {
            photoImgeView.alpha = 1;
        }
    }];

@Ricardo1980
Copy link
Author

Works perfectly! Thanks.
One question regarding memory management, isn't it there a retain cycle in photoImgeView?
I mean, try to change photoImgeView by cell.photoImgeView.
Thanks.

@asuralyc
Copy link

It works fine with UITableViewCell.

@Ricardo1980
Copy link
Author

Thanks.

@Nagarjun123
Copy link

It worked thanks @asuralyc

@Nagarjun123
Copy link

How to change white fadein background for this? Currently fadein is white i want it black or grey?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants