gpt4 book ai didi

ios 如何在 ViewController 中模拟后退按钮

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:50:52 25 4
gpt4 key购买 nike

我有更多从 rootviewcontroller 开始的 viewcontroller。因此,例如,我从 Controller A 开始,然后传递给 B,然后转到第三个 Controller C。

通常要返回,我们需要在左上角向后推。相反,我想知道是否可以通过代码使用后退按钮来代替 previus View Controller ,在这种情况下是 B。

继续下一个我用这个

ViewController *sc = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];

[[self navigationController] pushViewController:sc animated:YES];

最佳答案

简单

[[self navigationController] popViewControllerAnimated:YES];

关于ios 如何在 ViewController 中模拟后退按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9824734/

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