如何在没有导航控制器的情况下在故事板中执行动画自定义转场?
我需要在执行segue之前设置一些参数,所以我必须使用CUSTOM SEGUE,对吗? 在这种情况下,我会进行从一个屏幕到另一个屏幕的动画过渡,但我没有导航控制器(而且我不想插入一个!)
是否可以不使用导航控制器并使用自定义转场?
或者,是否可以为按钮设置一个操作并在执行转场之前执行一些代码行? 我找到了这个解决方案:
(IBAction)showDetailView:(id)sender {
//代码
......
[self PerformSegueWithIdentifier:@"ShowDetail" sender:sender];
但
它需要导航控制器...
谢谢大家,并对我的英语不好表示歉意!
I have the necessity to set some parameters before execute a segue, so I must use CUSTOM SEGUE, right?
In this case, I would make the transition, from a screen to another, animated but I don't have a NavigationController (and I don't want to insert one!)
Is it possible to not use a NavigationController and change views with a custom segue?
In alternative, there is the possibility to set an action for a button and execute some rows of code befor performing a segue?
I found this solution :
(IBAction)showDetailView:(id)sender {
//code
.....
[self performSegueWithIdentifier:@"ShowDetail" sender:sender];
}
but it need navigtion controller...
thank you to all and sorry for my bad englis!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您在 Storyboard 中创建 Segue 时,选择“modal”而不是“push”(自定义是指我认为您不需要的第三种类型)。选择segue 并使用属性检查器为其命名。在我的代码示例中,我使用名称“editTitleBlock”。
要在目标视图控制器(这将是模态视图控制器)上设置属性,请在第一个视图控制器中放置一个prepareForSegueMethod,如下所示:
要返回到第一个视图控制器,请使用:
When you create you segue in Storyboard, select "modal" instead of "push" (custom refers to a third type which I don't think you need). Select the segue and use the attributes inspector to give it a name. In my code example I use the name "editTitleBlock".
To set properties on the destination view controller (which will be the modal view controller) put a prepareForSegueMethod in your first view controller like this:
to get back to the first view controller use: