【问题标题】:TabBar and Navigation Controller resetTabBar 和导航控制器重置
【发布时间】:2021-05-14 04:05:33
【问题描述】:

我的主屏幕包含一个带有三个按钮的 TabBar。其中一个按钮为带有四个附加 ViewController 的流打开 NavigationContoller。 在此流程结束时,会弹出一个屏幕“Gratulations, bla bla bla ...” 在这个视图中是一个 UIButton “返回主屏幕”,它将主屏幕移动到 "tabBarController?.selectedIndex = 0" 到目前为止它有效! 但是,如果我再次单击 TabbarButton,我会再次看到屏幕“Gratulations, bla bla bla ...”。 谁能告诉我谁重置了 NavigationController 流程​​又开始了

谢谢丹尼斯

【问题讨论】:

    标签: swift uinavigationcontroller uitabbarcontroller uinavigationbar uitabbar


    【解决方案1】:

    当用户按下“返回主屏幕”按钮时添加以下代码行:

    navigationController?.popToRootViewControllerAnimated(true)
    

    【讨论】:

      猜你喜欢
      • 2013-09-21
      • 1970-01-01
      • 2018-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多