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

时光毁灭记忆、已成空白 提交于 2019-12-03 06:02:31

问题


Here's the screenshot:

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.


回答1:


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.




回答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



来源:https://stackoverflow.com/questions/26055040/uiactivityviewcontroller-not-showing-my-custom-activity-image-in-the-more-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!