IDMPhotoBrowser icon indicating copy to clipboard operation
IDMPhotoBrowser copied to clipboard

actionButtonImage not shown.

Open rameshpjpti opened this issue 6 years ago • 1 comments

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

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

rameshpjpti avatar Jun 30 '18 18:06 rameshpjpti

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;
}];

mobielbekeken-thijs avatar Sep 18 '18 08:09 mobielbekeken-thijs