In order to achieve such a soft keyboard will be on its own initiative to put the layout of the input box on top of the effect, you need to set the Input method properties, there are the following two ways to set:
First, set the following in the Java code, for example:GetWindow (). Setsoftinputmode (windowmanager.layoutparams.soft_input_adjust_resize| WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);Second, set the properties of its corresponding activity in androidmanifest.xml such as the following: Android:windowsoftinputmode= "Adjustresize"
Android:windowsoftinputmode = "Adjustresize" when the soft keyboard pops up. You want to lay out the main form layout again. and call the Onsizechanged method,
Remember that when we set it to "Adjustresize". Our interface is not set to full-screen mode, otherwise setting this property will not have any effect. And when we set
Android:windowsoftinputmode = "Adjustpan", the main form will not call the Onsizechanged method. Part of the interface will be covered by a soft keyboard. On
Will not be squeezed onto a soft keyboard.
Normally, when the property is set, the soft keyboard pops up. The input box will not be obscured.
However, this attribute is not valid in some cases, and now I am aware of the following two scenarios :
First, the current activity is set to full-screen properties. namely android:theme= " @android : Style/theme.blac K.notitlebar.fullscreen " Two, webview the relevant layout has been fixed height, here is also divided into two situations : 1. The root layout is fixed to a height, where the root layout is the outermost layout of the activity where the webview is located; c24> 2. The root layout is not fixed height, but the root layout is the framelayout layout. The WebView or its parent control is fixed to a height.
The above two fixed heights will cause the soft keyboard to obscure the input box problem. You need to pay extra attention.
PS: fixed height. means that the Layout_height attribute is given a detailed number of DP or PX.
Android WebView Soft Keyboard will obscure the input box related issues