jQuery Mobile 在输入焦点上显示键盘 [英] jQuery Mobile Show Keyboard on Input Focus
问题描述
我在聚焦文本输入时无法显示 Android 键盘.我在初始化页面的函数中有这个:
jQuery(document).bind('pageshow', function(){jQuery($inputItemReference).focus();jQuery($inputItemReference).prompt();});
$inputItemReference 是指向输入文本框的变量.
有人告诉我 prompt() 会显示键盘.然而,事实并非如此.当页面加载时,我只得到输入以显示闪烁的光标.如果我想要显示键盘,我必须再次点击输入.我希望在页面加载时正确显示键盘.有什么想法吗?谢谢.
如果您使用的是cordova/phonegap,请将其添加到config.xml:
I am having a problem getting the Android keyboard to show up when I focus a text input. I have this in my function that initializes the page:
jQuery(document).bind('pageshow', function()
{
jQuery($inputItemReference).focus();
jQuery($inputItemReference).prompt();
});
$inputItemReference is a variable that points to the input text box.
I was told that prompt() would show the keyboard. However, it does not. I am only getting the input to display the blinking cursor when the page loads. If I want the keyboard to be displayed, I have to tap the input again. I want the keyboard to be displayed right when the page loads. Any thoughts? Thanks.
If you are using cordova/phonegap add this to config.xml:
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
这篇关于jQuery Mobile 在输入焦点上显示键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!