gpt4 book ai didi

iphone - 如何关闭 View Controller 并返回到它的父 View Controller ?

转载 作者:行者123 更新时间:2023-11-28 20:14:37 25 4
gpt4 key购买 nike

我有一个来自另一个带有 XIB 文件的 View Controller 的弹出 View 。它从父 VC (detailViewController) 启动,但关闭代码在它自己的 VC (KNThirdViewController)

我正在使用此代码:https://github.com/kentnguyen/KNSemiModalViewController/blob/master/KNSemiModalViewControllerDemo/KNThirdViewController.xib

当从 (KNThirdViewController) 调用时

- (IBAction)dismissButtonDidTouch:(id)sender {
[self dismissModalViewControllerAnimated:NO];
}

应用返回到 rootViewController 而不是 detailViewController。它应该简单地关闭自身(KNThirdViewController 弹出式 VC)并将用户返回到 detailViewController

View Controller 呈现:

-(void)scriviBtnPress {

// You can also present a UIViewController with complex views in it
// and optionally containing an explicit dismiss button for semi modal
[self presentSemiViewController:semiVC withOptions:@{
KNSemiModalOptionKeys.pushParentBack : @(YES),
KNSemiModalOptionKeys.animationDuration : @(0.5),
KNSemiModalOptionKeys.shadowOpacity : @(0.3),
}];

最佳答案

像这样尝试:

[self.presentingViewController.presentingViewController dismissViewControllerAnimated:YES completion:NULL];

关于iphone - 如何关闭 View Controller 并返回到它的父 View Controller ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18507426/

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