objective-c – 我可以在没有StoryBoard segue的情况下进入另一
发布时间:2020-12-14 17:59:12 所属栏目:百科 来源:网络整理
导读:所以我想知道是否有可能从代码中的视图进行调用以转到另一个视图,而不是使用segue. 谢谢您的帮助. 解决方法 是的,如果您使用的是导航控制器,则只需按下导航控制器即可: [self.navigationController pushViewController:otherViewCon animated:YES]; 或者,如
所以我想知道是否有可能从代码中的视图进行调用以转到另一个视图,而不是使用segue.
谢谢您的帮助. 解决方法
是的,如果您使用的是导航控制器,则只需按下导航控制器即可:
[self.navigationController pushViewController:otherViewCon animated:YES]; 或者,如果您想要模态转换: [self presentModalViewController:otherViewCon animated:YES]; 这都假设self是一个UIViewController. 要从故事板设计的视图控制器获取otherViewCon: otherViewCon = [self.storyboard instantiateViewControllerWithIdentifier:@"Other View"]; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |