Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIActivityViewController not showing my custom activity image in the "MORE" list on iOS8

Here's the screenshot: enter image description here

In my subclass of UIActivity, I override the -activityImage method to use my own icon for the facebook share item, but it appears in the share panel but disappears in the MORE list.

enter image description here

like image 768
njuxjy Avatar asked Sep 26 '14 08:09

njuxjy


2 Answers

Quite old question, but maybe the solution is helpful for others too!

In your UIActivity subclass implement/overwrite the method

- (UIImage *)activityImage {
    return [UIImage imageNamed:@"Activity Icon"];
}

to return the image to be shown in the UIActivityViewController itself (as you've done).

In addition to this implement/overwrite the method

- (UIImage *)activitySettingsImage {
    return [UIImage imageNamed:@"Activity Settings Icon"];
}

to return an(other or the same) image to be shown in the more/settings view.

like image 137
LaborEtArs Avatar answered Nov 05 '22 23:11

LaborEtArs


Have you checked that your image has this format

For iPhone and iPod touch, images on iOS 7 should be 60 by 60 points; on earlier versions of iOS, you should use images no larger than 43 by 43 points. For iPad, images on iOS 7 should be 76 by 76 points; on earlier versions of iOS you should use images no larger than 60 by 60 points. On a device with Retina display, the number of pixels is doubled in each direction.

You can also check the reference: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivity_Class/index.html#//apple_ref/occ/instm/UIActivity/activityImage

like image 30
Luis Mariano Avatar answered Nov 06 '22 00:11

Luis Mariano