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

actionButtonImage not shown. #300

Open
rameshpjpti opened this issue Jun 30, 2018 · 1 comment
Open

actionButtonImage not shown. #300

rameshpjpti opened this issue Jun 30, 2018 · 1 comment

Comments

@rameshpjpti
Copy link

I want to use custom image in actionButtonImage but not showing using this following code. Have any idea?

browser.actionButtonImage = [UIImage imageNamed:@"delete.png"];

@mobielbekeken-thijs
Copy link

actionButtonImage (as well as some other properties) are being weakly referenced by IDMPhotoBrowser. This may cause the image to be deallocated before it's being used by IDMPhotoBrowser. To work around this, I did the following:

__block UIImage *actionButtonImage = [UIImage imageNamed:@"delete.png"];
browser.actionButtonImage = actionButtonImage;
[self presentViewController:browser animated:YES completion:^{
        //images below are weak referenced by IDMPhotoBrowser
        //by setting them as block (and releasing them here) we prevent these images to be unassigned from the IDMPhotoBrowser before being used
        actionButtonImage = nil;
}];

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

2 participants