Swift,呈现一个带有标签栏的新 uiview

标签 swift tabbar uitabcontroller

我试图在单击表格 View 单元格中的按钮后呈现一个新 View 。 View 可以显示但没有标签栏。有没有用标签栏显示 View 的解决方案?谢谢。

Storyboard Screenshot

使用 segue 或程序化是不正确的。

  func viewDetailAction(sender: UIButton){
    let vc = self.storyboard?.instantiateViewControllerWithIdentifier("patientDetailVC    ") as! PatientDetailViewController
  //        self.presentViewController(vc, animated: true, completion: nil)
 //        self.navigationController?.pushViewController(vc, animated: true)
     self.performSegueWithIdentifier("patientDetailCell", sender: self)
    }

最佳答案

更简单的方法是自己展示 VC

 self.presentViewController(vc, animated:true, completion:nil)

这将在您当前的 VC 上显示它,而不是在选项卡 barController 上显示它,因为它可能在 Storyboard segue 中完成

请忽略任何代码语法错误。

关于Swift,呈现一个带有标签栏的新 uiview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37005286/

相关文章:

swift - 从 UIViewController 使用 Segue 打开 UITabController - 如何将第三个选项卡显示为默认选项卡?

ios - 如何快速AirPrint整个屏幕的图片

ios - 将文件存储在公共(public)空间,并可通过 swift iOS 中的任何文件浏览器轻松访问

ios - 将 UDP 套接字绑定(bind)到蜂窝 IP

ios - 与应用程序和扩展程序共享时,UserDefaults 数据存储在哪里?

ios - 在将 ViewController 添加到 UITabBarController 之前加载数据

swift - UITabBar 在 "Back"按钮后消失

ios - 当我尝试对我的选项卡栏项目执行操作时,我很快,我只能创建一个 socket 或一个 socket 集合我该如何执行操作?

ios - 模态视图在关闭时更改我的选项卡

ios - 标签栏下方的 Swift View 布局