gpt4 book ai didi

ios - 关于 segue 到 viewcontroller 的问题

转载 作者:行者123 更新时间:2023-11-28 08:42:20 24 4
gpt4 key购买 nike

从iphone系统APP“联系人”,在“所有联系人”界面点击“添加”,会跳转到“新建联系人”界面。然后从“New Contact”GUI 中添加“new”项,然后单击“Done”,它将连接到联系人详细信息 GUI(屏幕截图 3)。问题是:我使用“Show(push)”从“Done”按钮转到图像 3,但是左下角的 NavagationItem 显示为“返回新联系人”而不是“返回所有联系人”。

我附上了截图来描述这个问题: screenshot

我尝试了两种方式:方式一:弹出与image2匹配的vc。问题是New Record页面会先跳转到image1,再跳转到image3。

if let nav = self.parentViewController as? UINavigationController {
if let vc0 = nav.childViewControllers.last as? AddRecordTableViewController {
nav.popViewControllerAnimated(true)
}
}
performSegueWithIdentifier(Constants.SegueAddRecordVCToViewRecordVC, sender: nil)

方式二:使用 removeFromParentViewController 丢弃 vc 匹配 image2。问题是左角的导航栏按钮仍然显示为“

if let nav = self.parentViewController as? UINavigationController {
if let vc0 = nav.childViewControllers.last as? AddRecordTableViewController {
vc0.removeFromParentViewController()
}
}
performSegueWithIdentifier(Constants.SegueAddRecordVCToViewRecordVC, sender: nil)

最佳答案

为什么不在按下“完成”时尝试使用 self.dismissViewControllerAnimated(true, completion: {});

关于ios - 关于 segue 到 viewcontroller 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36212420/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com