gpt4 book ai didi

ios - 在 iOS13 上编辑加载到 WKWebview 上的 HTML 文件时围绕 html 内容的边框

转载 作者:行者123 更新时间:2023-12-01 17:35:44 27 4
gpt4 key购买 nike

enter image description here

我正在尝试加载本地可编辑 html文件到 WKWebview . WKWebview成功加载html文件。但是,当我开始输入可编辑的 html文件中,键入的文本周围会出现一个类似 View 的黑色边框。此问题在 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>

最佳答案

<html>
<head>
<style type="text/css">
div {
outline: none
}
</style>
</head>
<body >

<div contenteditable="true">Type here</div>

</body>
</html>


将 outline:none 添加到 div 标签可以解决问题。

关于ios - 在 iOS13 上编辑加载到 WKWebview 上的 HTML 文件时围绕 html 内容的边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57456490/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com