ios - 如何在快速嵌入导航堆栈的 View Controller 中隐藏选项卡栏?

标签 ios swift uinavigationcontroller uitabbarcontroller

enter image description here

我在第二个标签栏(标签栏索引:1)中有一个 InvoiceVC,如上图所示。如果点击表格 View 单元格,我需要像下图一样转到 InvoiceDetailVC

enter image description here

如您在 InvoiceDetailVC 中所见,InvoiceDetailVC 底部没有选项卡栏,我的意思是底部有红色标记的选项卡。我需要删除那个标签栏。

我已经尝试使用 present modally 而不是 push show segue。但问题是,没有返回 InvoiceVC 的返回按钮

那我该怎么办?

enter image description here

最佳答案

在推送时在 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/

相关文章:

ios - 如何确保绘图操作在 Mac 上是像素对齐的?

ios - '@lvalue $T 7' is not identical to ' CGPoint!'

swift - 当 iOS 处于后台并收到远程通知时向 Watch 发送数据

swift - 什么时候需要执行 `reduce` 的内容?

swift - Alamofire4 在使用方法 : . 后抛出 "extra argument method"

iphone - UINavigationController 逻辑中 searchDisplayController.searchResultsTableView 的行为

ios - 使用 iOS/Phonegap 存储数千条记录(可离线使用)的选项

ios - 向 UITableViewController 内的表格 View 添加左右边距

ios - 从主屏幕中删除导航栏。

iphone - 如何通过UINavigationController设置一个navigationController?