问题描述
我注意到在iOS 10.3.1中,当使用safari并激活虚拟键盘时,您可以一直向上滚动页面,并在html元素和虚拟键盘之间留出空白空间(与body相同的颜色)。 p>您可以看到蓝色区域是检查员认为的html元素,并且在虚拟键盘与该区域之间存在白色间隔(或者如果将身体背景设置为黑色,则为黑色) html。
请注意,没有出现这种差距自动。出现键盘时必须向上滚动。我注意到这一点,因为我使用javascript做了一个滚动到底部来修复中国9键按钮(它将覆盖屏幕的底部,这恰好是textarea)的bug。
I noticed in iOS 10.3.1, while using safari and have the virtual keyboard activated, you can scroll the page up all the way and leave empty space (same color as body) between the html element and virtual keyboard.
You can see the blue area is what the inspector considers html element, and there is a white gap (or black if I set body background to black) between the virtual keyboard and the html.
Note that this gap doesn't appear automatically. You have to scroll up when the keyboard appears. I noticed this because I use javascript to do a scroll up to bottom to fix a bug with chinese 9 buttons keyboard (it will cover the bottom of the screen, which happens to be the textarea).
Lately, I experienced a similar situation with a Cordova WebApp and iOS10. The issue was back then, that the main view-container had a height of 100% and not 100vh. Take a look at your CSS or update your post with more information.
这篇关于如何修复iOS的iOS 10.3.1中Safari的html margin底部错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!