【问题标题】:How would I manually set the arrow direction of an options menu presented by a UIDocumentInteractionController?如何手动设置 UIDocumentInteractionController 呈现的选项菜单的箭头方向?
【发布时间】:2023-12-07 04:30:02
【问题描述】:

我的应用程序包含一个用于共享的选项菜单,当长按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

【问题讨论】:

    标签: ios swift uipopovercontroller uidocumentinteraction options-menu


    【解决方案1】:

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

    【讨论】:

      最近更新 更多