ARKit可以显示WKWebview吗? [英] Can ARKit display WKWebview?
问题描述
尝试过ARKit以显示WKWebView,我得到的只是一个显示背景但没有前景的页面.该页面可以滚动.我将Apple网页附加为屏幕截图.
Tried ARKit to show WKWebView and all I got is a page that shows background but no foreground. The page can be scrolled though. I attached Apple web page as screenshot.
代码如下:
DispatchQueue.main.async {
let webView = WKWebView(frame: CGRect(x: 0, y: 0, width: 640, height: 480))
let request = URLRequest(url: URL(string: "https://www.apple.com")!)
webView.load(request)
plane.firstMaterial?.diffuse.contents = webView
}
这是否意味着ARKit无法显示网页?我正在使用运行ARKit 2的iOS 12 beta2.我还关闭了应用传输安全设置",并允许任意加载.
Does that mean ARKit cannot display web page? I am using iOS 12 beta 2 running ARKit 2. I have also switch off App Transport Security Settings and allow arbitrary load.
我还浏览了该网站,发现有相同问题但没有解决方案的人: WKWebView是仅显示背景
I also look through this site and found someone with the same issue but no solution: WKWebView is showing only background
更新:它适用于UIWebView.
Update: It works for UIWebView.
推荐答案
使用Scenekit节点很难实现它,但是如果您使用SprikeKit节点就可以了.为此使用SpriteKit节点.
It would be difficult to implement it using Scenekit Nodes, but would be working if you use SprikeKit Nodes. Use SpriteKit nodes for this.
这篇关于ARKit可以显示WKWebview吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!