iOS 9-隐藏通过SFSafariViewController加载的网页底部的工具栏 [英] iOS 9 - hide toolbar at bottom of web page loaded via SFSafariViewController
问题描述
我试图隐藏导航工具栏(来回移动,在safari中打开...),该工具栏显示在使用SFSafariViewController加载URL的页面底部. 我尝试在导航控制器上设置以下属性,但无法正常工作/ [_safariViewController.navigationController setToolbarHidden:YES]; 当使用使用UIWebView类的视图控制器时,我能够隐藏它.有什么建议吗?
I am attempting to hide the navigation toolbar(go back and forward, open in safari ...) that appears at the bottom of a page that loads a URL using the SFSafariViewController. I tried setting the following property on the navigation controller but it did not work/ [_safariViewController.navigationController setToolbarHidden:YES]; I am able to get this to hide when using a view controller that uses the UIWebView class. Any suggestions?
谢谢
推荐答案
您可以做的是调整SafariViewController
的框架.
What you can do is adjust the frame of the SafariViewController
.
let safari = SFSafariViewController(url: URL(string: "https://wwww.google.co.nz")!)
self.present(safari, animated: true) {
let frame = safari.view.frame
frame.size = CGSize(width: frame.width, height: frame.height + 44.0)
safari.view.frame = frame
}
这篇关于iOS 9-隐藏通过SFSafariViewController加载的网页底部的工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!