简体   繁体   English

应用程序搞砸了键盘弹出窗口

[英]Application messed up on keyboard pop-up

In my web app my login page is deranged when opening the keyboard. 在我的网络应用程序中,打开键盘时我的登录页面被拆开了。 In android development this can be solved by modifying the android:windowSoftInputMode="stateVisible|adjustResize" in the manifest file. 在android开发中,这可以通过修改清单文件中的android:windowSoftInputMode="stateVisible|adjustResize"来解决。 Is there any way that this can be done for web-applications developed in Javascript ? 对于使用Javascript开发的Web应用程序,有什么方法可以做到这一点?

If your webapp is becoming deranged when the keyboard is scrolling up, often times it's more of a css problem then a javascript problem. 如果你的网页应用程序在键盘向上滚动时变得很乱,那么通常它更像是一个css问题,然后是一个javascript问题。 Since in most browsers the top of the keyboard will become the new bottom of the page when the keyboard is scrolled up. 因为在大多数浏览器中,当键盘向上滚动时,键盘的顶部将成为页面的新底部。 For instance if you set an element to position:absolute; bottom:0; 例如,如果将元素设置为position:absolute; bottom:0; position:absolute; bottom:0; you can see that the element will treat the top of the keyboard as the bottom of the page. 你可以看到该元素会将键盘顶部视为页面底部。

So if you have a lot of elements with position:relative; 所以如果你有很多position:relative;元素position:relative; or alot of elements that positions are based on the bottom of the window you could end up with a deranged view when the keyboard scrolls up. 或许多位置基于窗口底部的元素,当键盘向上滚动时,您可能会看到一个疯狂的视图。 Additionally there is some functions and calls you can make in javascript using window that allow you to change functionality of the window on keyboard up. 此外,还有一些函数和调用可以在javascript中使用window进行调用,允许您在键盘上更改窗口的功能。 That being said it is hard to say why your webpage is becoming deranged with such little information. 话虽如此,很难说为什么你的网页会因为这么少的信息而变得疯狂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM