Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What UIImage should I return from UIActivity activityImage?

I have created a subclass of UIActivity to present a custom activity on the Activity Sheet within my app. However I cannot get it to show my icon.

I have tried a few different images at typical icon sizes, e.g.:

- (UIImage *)activityImage { 
    return [UIImage imageNamed:@"my_app_icon.png"]; 
}

but I just get a gray square and my icon does not show at all.

EDIT: the real problem was that my XCode docs were out of date, so I did not have the information that the maximum image size is very limited.

like image 990
Bryan Avatar asked Sep 25 '12 22:09

Bryan


1 Answers

It doesn't look like you can set a background image to your UIActivity. According to the official doc: any color data in the image itself is ignored only the alpha is taken in account to act as a mask.

like image 64
tiguero Avatar answered Oct 09 '22 06:10

tiguero