问题
I was making a Phonegap App in which there is a input field inside a iscoll4 container. The gray background is of iscroll and a text field is a "Enter ID". The Screen Shot is before
When I click on the Text Box the keyboard Pops Up that is working fine but the text field is behind the keyboard and the user cant see the text field properly. The Screen Shot is before.
And as soon as I start typing the text box scrolls up.
My problem is that the text box should scroll up as soon as I click on text field and the keyboard is shown.
I am using Phonegap 2.2 and iscroll4. I am working on iPhone with iOS 5.1 and iOS 6.0.
I have already tried using following things
- iScroll.scrollToElement('#ID'); - It is scrolling up but immediately it get back to the previous position
- create a keyboard event using jQuery ( jQuery.event.trigger({ type : 'keypress', which : character.charCodeAt(32) });) - it dont work on iPhone.
来源:https://stackoverflow.com/questions/14050984/text-field-get-hidden-behind-softkeyboard-in-phonegap-on-iphone4s