jjzjj

SFSafariViewController

全部标签

ios - 在 iOS 9 中,为什么 SFSafariViewController 被推送而不是模态呈现?

我通过在UIViewController实例上调用presentViewController:animated:completion:来呈现一个SFSafariViewController。结果是它被推送(从右边滑入),就好像我在UINavigationController上调用了pushViewController:animated:>实例。我已经证实这一切都发生在主队列上。并且呈现ViewController本身不是模态(这应该无关紧要,但为了以防万一,我们可以排除这种可能性)。如果我将SFSafariViewController替换为UIViewController,它会按预期工

ios - 在 iOS 9 中,为什么 SFSafariViewController 被推送而不是模态呈现?

我通过在UIViewController实例上调用presentViewController:animated:completion:来呈现一个SFSafariViewController。结果是它被推送(从右边滑入),就好像我在UINavigationController上调用了pushViewController:animated:>实例。我已经证实这一切都发生在主队列上。并且呈现ViewController本身不是模态(这应该无关紧要,但为了以防万一,我们可以排除这种可能性)。如果我将SFSafariViewController替换为UIViewController,它会按预期工

ios - SFSafariViewController 崩溃 : The specified URL has an unsupported scheme

我的代码:ifleturl=NSURL(string:"www.google.com"){letsafariViewController=SFSafariViewController(URL:url)safariViewController.view.tintColor=UIColor.primaryOrangeColor()presentViewController(safariViewController,animated:true,completion:nil)}这只会在初始化时崩溃,但有异常(exception):ThespecifiedURLhasanunsupporteds

ios - SFSafariViewController 崩溃 : The specified URL has an unsupported scheme

我的代码:ifleturl=NSURL(string:"www.google.com"){letsafariViewController=SFSafariViewController(URL:url)safariViewController.view.tintColor=UIColor.primaryOrangeColor()presentViewController(safariViewController,animated:true,completion:nil)}这只会在初始化时崩溃,但有异常(exception):ThespecifiedURLhasanunsupporteds

ios - 如何正确删除 SFSafariViewController 作为 subview Controller ?

我正在使用thisSOanswer提供的技术像这样在SFSafariViewController中预加载一些URL:addChildViewController(svc)svc.didMoveToParentViewController(self)view.addSubview(svc.view)然后我尝试使用以下代码删除SafariViewController:svc.willMoveToParentViewController(nil)svc.view.removeFromSuperview()svc.removeFromParentViewController()现在我可以预加载

ios - 如何正确删除 SFSafariViewController 作为 subview Controller ?

我正在使用thisSOanswer提供的技术像这样在SFSafariViewController中预加载一些URL:addChildViewController(svc)svc.didMoveToParentViewController(self)view.addSubview(svc.view)然后我尝试使用以下代码删除SafariViewController:svc.willMoveToParentViewController(nil)svc.view.removeFromSuperview()svc.removeFromParentViewController()现在我可以预加载

ios - 更改 SFSafariViewController 的颜色?

正如标题所说;如何更改iOS9中新的SFSafariViewController的整体色调? 最佳答案 来自iOS10的一些消息:现在我们有两个属性来控制SFSafariViewController的整体外观来源:link当然,唯一的缺点是它不适用于旧版本。if#available(iOS10.0,*){safariVC.preferredBarTintColor=.blacksafariVC.preferredControlTintColor=.white}else{safariVC.view.tintColor=.someCol

ios - 更改 SFSafariViewController 的颜色?

正如标题所说;如何更改iOS9中新的SFSafariViewController的整体色调? 最佳答案 来自iOS10的一些消息:现在我们有两个属性来控制SFSafariViewController的整体外观来源:link当然,唯一的缺点是它不适用于旧版本。if#available(iOS10.0,*){safariVC.preferredBarTintColor=.blacksafariVC.preferredControlTintColor=.white}else{safariVC.view.tintColor=.someCol

objective-c - 我可以为 Safari View Controller 预加载 Web 内容吗?

我可以毫无问题地创建SafariViewController:letsvc=SFSafariViewController(URL:NSURL(string:remote_url)!,entersReaderIfAvailable:true)self.presentViewController(svc,animated:true,completion:nil)在向用户显示ViewController之前,有什么方法可以预加载URL吗?例如,我可以先在后台预加载URL(网页内容),然后在用户点击某些内容后,我可以立即将内容显示在SafariViewController中。用户会感觉页面加载

objective-c - 我可以为 Safari View Controller 预加载 Web 内容吗?

我可以毫无问题地创建SafariViewController:letsvc=SFSafariViewController(URL:NSURL(string:remote_url)!,entersReaderIfAvailable:true)self.presentViewController(svc,animated:true,completion:nil)在向用户显示ViewController之前,有什么方法可以预加载URL吗?例如,我可以先在后台预加载URL(网页内容),然后在用户点击某些内容后,我可以立即将内容显示在SafariViewController中。用户会感觉页面加载