gpt4 book ai didi

ios - 禁用 iPhone 共享表中的 "more"按钮

转载 作者:行者123 更新时间:2023-11-29 01:05:57 25 4
gpt4 key购买 nike

我想禁用共享表中的“更多”按钮。

请检查此图片:

enter image description here

还可以吗?谁能帮帮我?

我的代码如下:

let objectsToShare:NSArray = [firstActivityItem]
let vc = UIActivityViewController(activityItems: objectsToShare as [AnyObject], applicationActivities: nil)


vc.excludedActivityTypes=[UIActivityTypePostToWeibo,
UIActivityTypePrint,
UIActivityTypeCopyToPasteboard,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypePostToFlickr,
UIActivityTypePostToVimeo,
UIActivityTypePostToTencentWeibo,
UIActivityTypeAirDrop,UIActivityTypeAssignToContact,"com.apple.reminders.RemindersEditorExtension","com.apple.mobilenotes.SharingExtension"]

myviewcontroller.presentViewController(vc, animated: true, completion: nil)

我只想发送邮件、短信、Facebook 和 Twitter。是否可以通过编程方式自定义。

最佳答案

如果您的共享应用程序列表超过 4 项,如果我理解正确的话,将会自动显示更多内容。

所以我建议让我们点击“更多”,看看所有的应用程序列表都会为您提供什么,然后您应该排除所有您不想要的应用程序,

let objectsToShare:NSArray = [firstActivityItem]
let vc = UIActivityViewController(activityItems: objectsToShare as [AnyObject], applicationActivities: nil)

vc.excludedActivityTypes =
[UIActivityTypePostToWeibo,
UIActivityTypePrint,
UIActivityTypeCopyToPasteboard,
UIActivityTypeSaveToCameraRoll,
UIActivityTypeAddToReadingList,
UIActivityTypeAssignToContact,
UIActivityTypePrint,
UIActivityTypeMessage,
UIActivityTypeMail,
UIActivityTypeAirDrop,
UIActivityTypePostToFlickr,
UIActivityTypePostToVimeo,
UIActivityTypePostToTencentWeibo,
UIActivityTypeAirDrop,
UIActivityTypeAssignToContact,
"com.apple.reminders.RemindersEditorExtension","com.apple.mobilenotes.SharingExtension"]

myviewcontroller.presentViewController(vc, animated: true, completion: nil)

Reference

关于ios - 禁用 iPhone 共享表中的 "more"按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36363697/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com