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

2

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

Melanie answered 26/9, 2014 at 8:16 Comment(4)
Got the same problem on device but works fine on simulator.Shantishantung
Same problem here, anyone can help?Sepulchral
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.Steeplechase
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 deviceHowey
D
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.

Damned answered 28/2, 2016 at 8:31 Comment(2)
Does it a private API? I cannot find any documentation about activitySettingsImage. Will Apple approve my app in App Store using this?Sexy
Haven't had any problems yet :-). But your right, it isn't documented in the official docs!Damned
M
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

Muskellunge answered 26/5, 2015 at 19:42 Comment(2)
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.Gander
@Penguin: I had "ColorSpace: sRGB IEC61966-2.1" in XCode, it is applied for all of my images. How can I remove it?Sexy

© 2022 - 2024 — McMap. All rights reserved.