har*_*823 1 webkit objective-c ios wkwebview ios13
我正在尝试将本地可编辑html文件加载到上WKWebview。WKWebview成功加载html文件。但是,当我开始在可编辑html文件中键入内容时,键入的文本周围会出现类似黑色边框的视图。在iOS12上无法重现此问题。
(void)viewDidLoad
{
[super viewDidLoad];
NSBundle *bundle = [NSBundle mainBundle];
NSURL *indexFileURL = [bundle URLForResource:@"index" withExtension:@"html"];
[self.wkWebView loadRequest:[NSURLRequest requestWithURL:indexFileURL]];
}
index.html:
<html>
<body>
<div id="content" contenteditable="true" style="font-family: Helvetica"> Type here </div>
</body>
<html>
Run Code Online (Sandbox Code Playgroud)
<html>
<head>
<style type="text/css">
div {
outline: none
}
</style>
</head>
<body >
<div contenteditable="true">Type here</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在div标签中添加outline:none即可解决此问题。
| 归档时间: |
|
| 查看次数: |
211 次 |
| 最近记录: |