我在第二个标签栏(标签栏索引:1)中有一个 InvoiceVC,如上图所示。如果点击表格 View 单元格,我需要像下图一样转到 InvoiceDetailVC
如您在 InvoiceDetailVC 中所见,InvoiceDetailVC 底部没有选项卡栏,我的意思是底部有红色标记的选项卡。我需要删除那个标签栏。
我已经尝试使用 present modally 而不是 push show segue。但问题是,没有返回 InvoiceVC 的返回按钮
那我该怎么办?
最佳答案
在推送时在 prepareforsegue
中使用并将 hidesBottomBarWhenPushed
设置为 true 以隐藏目标 View Controller 上的标签栏。
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "InvoiceVC") {
let indexPath: IndexPath? = tableView.indexPathForSelectedRow
let destViewController = segue.destination as? InvoiceVC
destViewController?.recipeName = recipes[indexPath?.row ?? 0]
destViewController?.hidesBottomBarWhenPushed = true
}
}
关于ios - 如何在快速嵌入导航堆栈的 View Controller 中隐藏选项卡栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50167980/