我想阻止键盘推高webvIEw.
有人有想法吗?
解决方法 在焦点上,设置window.scrollTo(0,0);这可以防止键盘完全推送webvIEw$('input').on('focus',function(e) { e.preventDefault(); e.stopPropagation(); window.scrollTo(0,0); //the second 0 marks the Y scroll pos. Setting this to i.e. 100 will push the screen up by 100px. });
如果您不想为Y滚动位置设置静态值,请随意使用此short plugin I’ve written that automatically aligns the keyboard underneath the input field.它并不完美,但它可以完成工作.只需在焦点上调用它,如上所示:
setKeyboardPos(e.target.ID);总结
以上是内存溢出为你收集整理的如何使用phonegap防止键盘在iOS应用程序中推送webview全部内容,希望文章能够帮你解决如何使用phonegap防止键盘在iOS应用程序中推送webview所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)