我的应用程序中的 segues 有点问题。我正在尝试手动 PUSH segue。但是导航项/ Controller /栏在目标 Controller 上不可见。当我使用按钮并使用该按钮继续定位 View Controller 时,导航栏可见:/
我的代码很简单:
[self performSegueWithIdentifier:@"MySegue" sender:self];
MySegue 是将 segue 从 UINavigationController 的 Root View Controller 推送到目标 Controller 。
连这个都不行
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle mainBundle]];
UIViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"TargetViewController"];
[self.navigationController pushViewController:controller animated:YES];
即使我在 Storyboard中手动设置顶部栏(导航项)
感谢您的帮助:)
最佳答案
删除从 StaznostiViewController 到 StaznostViewController 的转场。按住 Control 从 StaznostiViewController 对象(在 View 下方的栏中)拖动到 StaznostViewController,而不是从 StaznostiViewController View 或 StaznostiViewController tableview 原型(prototype)单元格。选择推送样式。随心所欲地命名您的 segue。
在您的代码中,在您为动态按钮定义的目标操作方法中,这是您调用方法 performSegueWithIdentifier 的地方。
此外,请确保在 StaznostViewController 的属性中,您将 Top Bar 的属性设置为 Inferred。
关于iphone - 手动 segue 时导航栏不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18943358/