当 SFSafariViewController 关闭时,我需要禁用状态栏的“隐藏动画”。 正常 Facebook 登录后,请求权限。
因为在帧更改时制作了糟糕的动画..
在我的 Storyboard中,状态栏被隐藏,并且我的 View 有一个约束“顶部空间:顶部布局”
最佳答案
刚刚找到解决方案:
如果我创建并呈现 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];
实现委托(delegate) (SFSafariViewControllerDelegate
) 方法:
- (void)safariViewControllerDidFinish:(SFSafariViewController *)controller
{
[[UIApplication sharedApplication] setStatusBarHidden:YES];
}
VC呈现精美,没有状态栏!并且在解雇期间不会产生不良影响。
即使使用 Facebook SDK(来自 CocoaPods 的 4.6.0)调用的 SFSafariViewController
,仅实现委托(delegate)方法也能完美工作
编辑:
进行其他测试,看起来委托(delegate)方法没有按预期工作;
但是只是实现:
View controller-based status bar appearance : FALSE
在.plist文件中足以隐藏SFSafariViewController
中的状态栏
关于ios9 - 在 SFSafariViewController 关闭时,禁用状态栏隐藏动画 [iOS 9],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32583765/