iOS7 UIModalTransitionStyleFlipHorizo​​ntal在转换后反弹 [英] iOS7 UIModalTransitionStyleFlipHorizontal bounces after transition

查看:109
本文介绍了iOS7 UIModalTransitionStyleFlipHorizo​​ntal在转换后反弹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iOS 7更新我的应用程序,我发现了一个奇怪的问题。我将使用 UIModalTransitionStyleFlipHorizo​​ntal 呈现包含在UINavigationController中的UIViewController。

I'm updating my app for iOS 7 and I discovered a weird problem. I'm presenting a UIViewController wrapped in a UINavigationController with UIModalTransitionStyleFlipHorizontal.

在iOS 6中它工作正常,但在iOS 7中,导航栏在转换后反弹。这与状态栏有关吗?我已将主导航栏的半透明度设置为

In iOS 6 it works fine, but in iOS 7 the navigation bar bounces after the transition. Does this have something to do with the status bar? I've set translucency of the main navigation bar to NO.

在Info.plist中,查看基于控制器的状态栏外观设置为NO。

In the Info.plist, View controller-based status bar appearance is set to NO.

这是一个GIF,在最小的演示应用程序中显示问题:

And here is a GIF showing the problem in a minimal demo app:

这是我的代码:

feedNavigationController = [[UINavigationController alloc] init];
feedNavigationController.navigationBar.translucent = NO;

SettingsViewController *settingsVC = [[SettingsViewController alloc] init];

feedNavigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[feedNavigationController setViewControllers:[NSArray arrayWithObjects:settingsVC, nil]];

[self presentViewController:feedNavigationController animated:YES completion:nil];


推荐答案

这似乎是一个UIKit错误。以下解决方法似乎为我解决了这个问题。

This appears to be a UIKit bug. The following workaround seems to resolve the issue for me.

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.navigationController.navigationBar.layer removeAllAnimations];
}

(将此位置放在正在转换的视图控制器中)。

(Place this in the view controller you are transitioning to).

这篇关于iOS7 UIModalTransitionStyleFlipHorizo​​ntal在转换后反弹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆