我正在呈现UIActivityController但它在屏幕上显示为一半。
let textToShare = "This is awesome! Check out this website about it!"
if let myWebsite = NSURL(string:urlShare) {
let objectsToShare = [textToShare, myWebsite]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
//New Excluded Activities Code
activityVC.excludedActivityTypes = [UIActivityTypeAirDrop, UIActivityTypeAddToReadingList]
self.navigationController!.presentViewController(activityVC, animated: true, completion: nil)
答案 0 :(得分:1)
尝试在POP UPViewController内添加
var popup = UIPopoverController(contentViewController: controller)
popup.presentPopoverFromRect(CGRectMake(self.view!.frame.size.width / 2, self.view!.frame.size.height / 4, 0, 0), inView: self.view!, permittedArrowDirections: .Any, animated: true)
此处,控制器是您的 activityVC
答案 1 :(得分:0)
您是否尝试self.presentViewController
代替当前ViewController
而非self.navigationController
。
由于我的rootViewController
较大,我用这个问题,所以当使用self.navigationController
进行展示时,它会被切断。