14

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

njuxjy
  • 415
  • 4
  • 13
  • Got the same problem on device but works fine on simulator. – Henry Dec 05 '14 at 07:09
  • Same problem here, anyone can help? – ZYiOS Dec 13 '14 at 08:52
  • 1
    I have the same problem. You can use a normal image when you set your custom activity category as UIActivityCategoryShare, though. So if you wish, you can use the standard blue Facebook logo without issues. That's what I did for Instagram. – cohenadair Jan 19 '15 at 23:29
  • did you use the exact size image? like 250 px .png or format of image is correct? As simmulater run even if image is not correct format or typecast,while fail in real device – 9to5ios Mar 31 '15 at 10:07

2 Answers2

6

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.

LaborEtArs
  • 1,938
  • 23
  • 27
  • Does it a private API? I cannot find any documentation about `activitySettingsImage`. Will Apple approve my app in App Store using this? – Balazs Nemeth Aug 23 '16 at 22:01
  • Haven't had any problems yet :-). But your right, it isn't documented in the official docs! – LaborEtArs Aug 24 '16 at 03:35
2

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

  • One more thing. If your image have a colorSync Profile, then it'll be not read. I did not know that, so I waste my time. So I suggest remove colorSync Profile. – Penguin Jun 28 '15 at 18:03
  • @Penguin: I had "ColorSpace: sRGB IEC61966-2.1" in XCode, it is applied for all of my images. How can I remove it? – Balazs Nemeth Aug 23 '16 at 22:57