如何从iOS Native Sharing功能中删除一些选项? [英] How to remove some option from the iOS Native Sharing abilities?
问题描述
我正在开发一款针对iOS的游戏,想知道如何在自动共享时删除iOS提供的一些原生选项,例如分配给联系人& 打印。我已经做了很多关于这方面的研究,我能找到的最接近的建议是调查UIActivityViewController,但是我找不到我的解决方案,我附加了两个图像,一个是现在的样子,2个是怎样的它需要在最后删除选项,谢谢!
I am working on a game for iOS and would like to know how remove some of the native options iOS offers when sharing automatically, such as "assign to contact" & "print". I have done a lot of research on this, the closest I could find is a suggestion to look into the UIActivityViewController but I haven't been able to find my solution, I am attaching two images, one of how it looks now and 2 how it needs to be at the end with the options removed, thanks!!!
推荐答案
查看 excludedActivityTypes
的属性> UIActivityViewController
。
NSArray *items = ... // your activity items
UIActivityViewController *activityView = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:nil];
activityView.excludedActivityTypes = @[ UIActivityTypeAssignToContact, UIActivityTypePrint ];
activityView.completionHandler = ... // your completion block
// display activity view here
这篇关于如何从iOS Native Sharing功能中删除一些选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!