简体   繁体   中英

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. Is there any way that this can be done for web-applications developed in Javascript ?

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. 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; 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; 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. That being said it is hard to say why your webpage is becoming deranged with such little information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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