项目中的web app在键盘升起后,ios端界面还可以上下滑动,用户体验很差,查阅资料后发现是项目中使用的cordova插件keyboard少了一项配置。如下:
Keyboard.shrinkView:设置为true可以在键盘升起时缩小视图;
Keyboard.disableScrollingInShrinkView:设置为true可以在视图缩小时禁止滚动;
具体使用方法时在项目中的config.xml文件中新增两项:
<preference name="KeyboardShrinksView" value="true" /> <preference name="KeyboardDisableScrollingInShrinkView" value="true" />
链接如下: