在SFSafariViewController解除,禁用状态栏隐藏动画[iOS 9]

时间:2015-09-15 10:30:33

标签: ios9

我需要禁用"隐藏动画"解除SFSafariViewController时状态栏的状态。 正常的Facebook登录后,请求权限。

因为在帧更改时制作了错误的动画..

在我的故事板中,状态栏被隐藏,我的视图有一个约束"顶部空间:顶部布局"

1 个答案:

答案 0 :(得分:2)

刚刚找到解决方案:

如果我创建并呈现SFSafariViewController

#import <SafariServices/SafariServices.h>


SFSafariViewController *sfc = [[SFSafariViewController alloc] initWithURL:[NSURL URLWithString:@"http://google.com"]];
sfc.delegate = self;
[self presentViewController:sfc animated:YES completion:nil];

实现委托(SFSafariViewControllerDelegate)方法:

- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
}

VC没有状态栏就很漂亮!并且在解雇期间不会产生不良影响。

即使使用Facebook SDK调用的SFSafariViewController(来自CocoaPods的4.6.0),只实现委托方法也能很好地工作

修改

执行其他测试,看起来委托方法无法按预期工作;

刚刚实施:

View controller-based status bar appearance : FALSE

在.plist文件中足以隐藏SFSafariViewController

中的状态栏