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

社会主义新天地 提交于 2019-12-02 20:42:01

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.

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

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