在SFSafariViewController关闭时,禁用状态栏隐藏动画[iOS 9] [英] At SFSafariViewController dismiss, disable status bar hide animation [iOS 9]

查看:86
本文介绍了在SFSafariViewController关闭时,禁用状态栏隐藏动画[iOS 9]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在关闭SFSafariViewController时,我需要禁用状态栏的隐藏动画". 在正常的Facebook登录后,需要权限请求.

I need to disable the "hide animation" of the status bar when the SFSafariViewController is dismissed. After a normal Facebook login, permission request.

因为在换帧时动画效果很差.

Because makes a bad animation on frame change..

在情节提要中,状态栏处于隐藏状态,并且视图具有顶部空间:顶部布局"约束

In my storyboard the status bar is hidden and my views have a constraint "Top space to: Top layout"

推荐答案

刚刚找到了解决方案:

如果我使用以下方法创建并显示SFSafariViewController:

If i create and present SFSafariViewController with:

#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非常漂亮,没有状态栏!并且在解雇期间不会造成不良影响.

The VC is presented beautifully without status bar! And doesn't make a bad effect during dismiss.

即使使用Facebook SDK调用的SFSafariViewController(来自CocoaPods的4.6.0版),仅实现委托方法也可以完美地工作

Implementing just the delegate method works perfectly even with a SFSafariViewController called by Facebook SDK (4.6.0 from CocoaPods)

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

Doing other tests, looks like the delegate method doesn't work as expected;

但是只是实施:

View controller-based status bar appearance : FALSE

在.plist文件中足以将状态栏隐藏在SFSafariViewController

In the .plist file is enough to hide the status bar in a SFSafariViewController

这篇关于在SFSafariViewController关闭时,禁用状态栏隐藏动画[iOS 9]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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