【发布时间】:2018-01-12 05:05:35
【问题描述】:
我将 UIViewController 自定义为 PopoverViewController,当我展示它时,我无法触摸导航栏和标签栏
我搜索了一段时间,我得到了: 在第一个 ViewController 代码的 prepare(for segue: UIStoryboardSegue, sender: Any?) 中:
if segue.identifier == "ShowChoice"{
let poper = segue.destination
poper.modalPresentationStyle = .popover
poper.popoverPresentationController?.delegate = self
let point = CGPoint(x: self.view.bounds.midX, y: self.view.bounds.midY + 5)
poper.popoverPresentationController?.sourceView = self.view
poper.popoverPresentationController?.sourceRect = CGRect(origin: point, size: CGSize.zero)
poper.popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection(rawValue: 0)
//here I set [self.view] to passthroughViews and it work i can interact with all thing in self.view but I can't interact with Navigation Button or Tab bar item!
poper.popoverPresentationController?.passthroughViews = [self.view]
}
}
我只能将 UIView 设置为 passthroughViews 但我想设置导航栏或标签栏
谢谢!
【问题讨论】:
-
您必须在此处显示更多上下文(更多代码),因为这对我来说很好。从您的代码行中,我们无法判断您尝试从哪里设置它,或者它是否全部正确连接。
-
@Terje 我更新了你能看看吗?
标签: ios swift ios-app-group