0
點擊輸入在頁面底部的文本輸入,鍵盤將覆蓋輸入,則會出現一個虛擬鍵盤(如預期的那樣)。問題在於虛擬鍵盤與焦點文本輸入重疊。所以,當我輸入時,我看不到輸入的內容。我也無法向下滾動到底部以查看文本框,因爲該頁面總是回退。我使用PhoneGap的3.5版本和jQuery 1.9.1在Phonegap中一旦點擊輸入字段
點擊輸入在頁面底部的文本輸入,鍵盤將覆蓋輸入,則會出現一個虛擬鍵盤(如預期的那樣)。問題在於虛擬鍵盤與焦點文本輸入重疊。所以,當我輸入時,我看不到輸入的內容。我也無法向下滾動到底部以查看文本框,因爲該頁面總是回退。我使用PhoneGap的3.5版本和jQuery 1.9.1在Phonegap中一旦點擊輸入字段
我解決了它的focusin
和focusout
jQuery方法:
//JS : OnReady event:
var windowHeightSeventyPercent = parseInt(screen.height * 0.7); //To support multiple devices
$("input").focusin(function(){
$("body").height($("body").height()+parseInt(windowHeightSeventyPercent)); //Make page body scroll by adding height to make user to fillup field.
});
$("input").focusout(function(){
$("body").height($("body").height()-parseInt(windowHeightSeventyPercent));
});
添加以下偏好config.xml中
<preference name="android-windowSoftInputMode" value="adjustResize|stateHidden" />
http://jsfiddle.net/4dLwezw1/3/ – Pawan 2014-10-31 12:07:02
應用後,您修復仍然有同樣的問題,你可以看看這個鏈接。 http://jsfiddle.net/4dLwezw1/3/ – Pawan 2014-10-31 12:08:52
你使用'Phonegap Build'嗎?如果是這樣,請分享'config.xml'文件?非常感謝。 – byJeevan 2014-11-01 09:28:09