【问题标题】:How to open a Particular tab by default when VC loads, How to move to index Tab when child ViewController Opened in CAPSPageMenu?VC加载时如何默认打开特定选项卡,在CAPSPageMenu中打开子ViewController时如何移动到索引选项卡?
【发布时间】:2019-12-30 09:03:49
【问题描述】:

我在 Swift 4.2

中实现了https://github.com/PageMenu/PageMenu

我的屏幕如下所示:

1.https://ibb.co/QdkFdMR

2.https://ibb.co/cksN3ww

当我点击Profile Details编辑按钮时,我通过以下代码导航到名为DoctorPersonalEdit的VC:

let personalDetail = self.storyboard?.instantiateViewController(withIdentifier: "DoctorPersonalEdit") as! DoctorPersonalEdit
self.parentNavigationController?.pushViewController(personalDetail, animated: true)

直到这里一切正常,之后当我点击 保存 按钮时,我想转到上一页,即第一个屏幕截图,我怎样才能返回上一页。此外,当第一次加载屏幕时,我必须突出显示第三个标签Business Page。有人可以帮助我吗?我尝试搜索库但找不到任何解决方案。

【问题讨论】:

    标签: ios swift4.2 xcode10.1


    【解决方案1】:

    您是否尝试过解雇 VC ? 在你的“saveBtn”IBAction 上做:

    self.presentingViewController?.dismiss(animated: true, completion:nil)
    

    你是如何实现标签的?您是否使用 Switch Case 在它们之间切换?如果是这种情况,您只需更改默认值即可。

    【讨论】:

      【解决方案2】:

      使用这行代码

      _ = navigationController?.popViewController(animated: true)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-09-25
        • 2020-06-28
        • 2018-04-29
        • 2017-01-28
        相关资源
        最近更新 更多