5

我正在 Appverse(多平台 webkit 容器,如 phonegap)上开发移动应用程序,它在 iOS 上运行非常流畅。但是,在 Android 上使用相同的应用程序时,我发现了严重的问题。

下拉列表显示正确,但是当我单击它们时,原生下拉列表(滚轮)会在几分之一秒内出现并消失。

关于可能发生什么的任何线索?

该应用程序使用 jQuery Mobile,并且下拉菜单是特别原生的。(在上一个测试中,我使用的是纯 HTML 页面,如下图,结果相同)

编辑:测试到 WebView 的 HTML 代码就是这个:

 <html>
   <head></head>
   <body><form>
      <select id='myoptions'>
        <option>Option 1</option>
        <option>Option 2</option>
        <option>Option 3</option>
      </select>
   </form></body>
 </html>
4

1 回答 1

3

(Answering my own post)

After reading tons and tons of logs, I've found the reason of this problem. This happens because the application goes to background when the software keyboard appears and this forces the dropdown -contained in the Webview- to close. Similar issue here:

WebView hides soft keyboard during loadUrl(), which means a keyboard cannot stay open while calling javascript

Since the problem has been detected only in certain versions of Android, I'll workaround it by using the dropdown UI of jQueryMobile. Ugly, slow, fragile... but it works.

于 2013-09-13T15:44:23.413 回答