在 IOS 中检查 WKWebView 中的下拉列表

Check for Drop Down List in WKWebView in IOS

我目前正在开发响应式混合应用程序。 我们知道如何让下拉列表在 WKWebView 中工作吗?它目前不响应触摸并选择列表中的第一项而不拉起下拉列表。 我知道这在 UIWebView 中有效,但在 WKWebView 中无效。 任何想法表示赞赏。

更新为 HTML 代码:

<ul id="select-list" class="select-list" tabindex="-1" role="listbox" style="top: 18px; width: 235px; display: block;"><li id="list-option0" role="option" class="select-option is-selected" tabindex="-1">Choose</li><li id="list-option1" role="option" class="select-option" tabindex="-1">Number1</li></ul>

更多更新: 使用 WKWebKit 而不是 UIWekKit 时,会调用 Javascript 中的文档 onResize。

那不是下拉菜单。那是一个列表变成了下拉列表。我认为为了获得最佳的移动兼容性,您需要一个普通的 select 元素。