[英]Can WKWebView load local HTML5 for writing?
I'm trying to do something like hybird with WKWebView.我正在尝试用 WKWebView 做一些类似 hybird 的事情。 I finished the HTML5 pages, and let it displayed in WKWebView in a macOs App.
我完成了 HTML5 页面,并让它显示在 macOs 应用程序中的 WKWebView 中。 All things go well, but I can't input any character into the field in the macOs WKWebView.
一切顺利,但我无法在 macOs WKWebView 的字段中输入任何字符。 My question is: Is there any way to let the field can be input text in macOs WKWebView?
我的问题是:有什么方法可以让字段可以在 macOs WKWebView 中输入文本?
FYI, follow code can enable input for the field: wkWebView.load(URLRequest.init(url: URL.init(string: "http://localhost:4200")!))仅供参考,按照代码可以启用该字段的输入: wkWebView.load(URLRequest.init(url: URL.init(string: "http://localhost:4200")!))
FYI, follow code can't input any thing for the field: wkWebView.loadFileURL(indexUrl, allowingReadAccessTo: readAccessUrl)仅供参考,以下代码不能为该字段输入任何内容:wkWebView.loadFileURL(indexUrl, allowedReadAccessTo: readAccessUrl)
How can I let the field be enabled to input, with the loadFileURL method?如何使用 loadFileURL 方法让该字段能够输入?
I've found the reason caused the problem: As I set the WindowMask in WindowController.我找到了导致问题的原因:因为我在 WindowController 中设置了 WindowMask。 Thanks All.
谢谢大家。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.