iOS : activityType 不适用于 UIactivityViewController
iOS : activityType doesn't work on UIactivityViewController
嗨,这是我的代码,我已经实现了 UIactivityViewCotroller,但是当我点击时,我没有看到邮件和 Facebook 应用程序
@IBAction func activityView(_ sender: UIButton) {
let text = "This is some text that I want to share."
let textToShare = [ text ]
let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
activityViewController.excludedActivityTypes = [ UIActivityType.airDrop, UIActivityType.postToFacebook, UIActivityType.mail ]
self.present(activityViewController, animated: true, completion: nil)
}
但我没有看到那些应用
我该怎么办?
替换函数如下
@IBAction func activityView(_ sender: UIButton) {
let text = "This is some text that I want to share."
let textToShare = [ text ]
let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
activityViewController.excludedActivityTypes = [ UIActivityType.airDrop ]
self.present(activityViewController, animated: true, completion: nil)
}
Activity Controllers excludedActivityTypes
表示您要排除那些要在 activityController
中列出的共享选项
嗨,这是我的代码,我已经实现了 UIactivityViewCotroller,但是当我点击时,我没有看到邮件和 Facebook 应用程序
@IBAction func activityView(_ sender: UIButton) {
let text = "This is some text that I want to share."
let textToShare = [ text ]
let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
activityViewController.excludedActivityTypes = [ UIActivityType.airDrop, UIActivityType.postToFacebook, UIActivityType.mail ]
self.present(activityViewController, animated: true, completion: nil)
}
但我没有看到那些应用 我该怎么办?
替换函数如下
@IBAction func activityView(_ sender: UIButton) {
let text = "This is some text that I want to share."
let textToShare = [ text ]
let activityViewController = UIActivityViewController(activityItems: textToShare, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
activityViewController.excludedActivityTypes = [ UIActivityType.airDrop ]
self.present(activityViewController, animated: true, completion: nil)
}
Activity Controllers excludedActivityTypes
表示您要排除那些要在 activityController