如何手动设置UIDocumentInteractionController提供的选项菜单的箭头方向?

时间:2015-07-16 22:09:34

标签: ios swift uipopovercontroller uidocumentinteraction options-menu

我的应用程序包含一个用于共享的选项菜单,该菜单在长按UITableViewCell时显示。如果屏幕上的UITableViewCell过高,则选项菜单中的箭头会低于UITableViewCell。有没有办法手动设置箭头方向?

我用来显示选项菜单的代码是:

self.documentInteractionController = UIDocumentInteractionController(URL: fileShareURL)

self.documentInteractionController.delegate = self

self.documentInteractionController.UTI = "public.xml"

self.documentInteractionController.presentOptionsMenuFromRect(self.view.frame, inView: self.view, animated: true)

其中documentInteractionController被定义为var documentInteractionController: UIDocumentInteractionController!的类变量,fileShareURL是指向我想要分享的文件的NSURL

1 个答案:

答案 0 :(得分:0)

我发现问题不在于UITableViewCell的位置,而在于我在哪里展示选项菜单。我的代码从屏幕顶部显示选项菜单,而不是从单元格的位置。