gpt4 book ai didi

jquery - Phonegap iOS iScroll 5 View 在虚拟键盘上向上移动

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:37:28 35 4
gpt4 key购买 nike

我正在使用 Phonegap、jQuery 和 iScroll 5 为 iOS 构建原生应用。 iScroll 工作完美,除了当我专注于页脚中的输入字段时。虚拟键盘出现并将整个 View 向上推。页眉不在 View 中,我无法滚动到页面顶部。当输入字段失去焦点或模糊时,一切都会恢复正常。我读到 iScroll 没有检测到屏幕尺寸变化,但我不确定如何修复它。我试过 window.scrollTo(0, 0) 和 scrollTop() 但没有成功。谢谢!

最佳答案

我为此苦苦挣扎了数周。

尝试

body{
overflow: hidden;
position: fixed;
top:0;
min-height: 480px; /* Window height for iPhone 5*/
}

在xml中:

<preference name="HideKeyboardFormAccessoryBar" value="true" />

我更改了 CDVViewController.m

来自

CGFloat actualKeyboardHeight = (keyboardFrame.size.height - accessoryHeight);
newFrame.size.height -= actualKeyboardHeight;

newFrame.size.height -= 0;

现在这对我有用,只要我在一个页面上没有多个输入字段,而且我实际上需要一些滚动。

关于jquery - Phonegap iOS iScroll 5 View 在虚拟键盘上向上移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21010323/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com