Hybrid app Friends will use such a development model, the app is native, the content is mobile web. For Android, for example, the Android app uses a WebView control to load the mobile Web,webview control with full-screen settings. Then the problem, if it is a form page, there are many input boxes, click the top of the input box, the mobile input method will block the bottom of the input box, can not see the contents of the input box.
How to fix it, take a look at the code:
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8" /> <Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <title>Mobile Input Method block input box</title> <style>input{width:100%;Line-height:1.5rem;Border:1px solid Red; }. Block-fill{Height:500px; } </style> </Head> <Body> <DivID= "Main"> <!--Placeholder Div - <Divclass= "Block-fill"></Div> <!--need to focus - <inputID= "Input"type= "text"></input> </Div> </Body> <Script> //Get page Height varclientheight=Document.body.clientHeight; //Setting the monitoring focus eventDocument.body.addEventListener ("Focus", function(e) {varFocuselem=document.getElementById ('input') }, true); //Setting the Listening window change TimeWindow.addeventlistener ("Resize", function() { if(Focuselem&&Document.body.clientHeight<clientheight) { //use the scrollIntoView method to control the input boxFocuselem.scrollintoview (false); } }); </Script></HTML>
It is easy to solve this problem by JS. (I started thinking I needed the app to set it up)
Solution to the mobile input input box blocking method