PresentModalViewController 没有故事板风格的动画

发布于 2024-12-20 11:20:06 字数 261 浏览 3 评论 0原文

我有一个使用传统 nib 界面文件创建的现有 iPhone 应用程序。现在我要把应用程序转换成iOS5故事板风格的界面。我已经更改了几乎所有界面文件并且工作正常。

但我遇到了一个小问题。我的现有应用程序有一个没有动画的 presentModalViewController:animated: 代码。这是通过将 NO 设置为动画属性来实现的。我在使用 segues 做同样的事情时遇到了问题。我找不到任何属性来禁用 Segues 中的动画。

I have a existing iPhone application created using traditional nib interface files. Now I am going to convert the application into iOS5 story board style interfaces. I have changed almost all interface files and working fine.

But I am comeup with small issue. My Exsiting application have a code for presentModalViewController:animated: without animation. That's by setting NO to animated property. I have a problem with doing the same with segues. I can't find any attribute to disable animations in segues.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世界等同你 2024-12-27 11:20:06

我使用自定义 segue 解决了上述问题。我通过扩展 UIStoryboardSegue 类创建了自定义 Segue,并向 PresentModalViewController 添加了代码,但没有动画。这是上述问题的解决方案。

#import "ModalViewWithoutAnimation.h"

@implementation ModalViewWithoutAnimation 
- (void)perform {
  [self.sourceViewController presentModalViewController:self.destinationViewController animated:NO]; 
} 
@end

谢谢

I resolve above issue using custom segue. I created custom segue by extending UIStoryboardSegue class and added code to presentModalViewController without animating. Here's the solution to above question.

#import "ModalViewWithoutAnimation.h"

@implementation ModalViewWithoutAnimation 
- (void)perform {
  [self.sourceViewController presentModalViewController:self.destinationViewController animated:NO]; 
} 
@end

Thanks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文