Solve the situation that black blocks appear briefly when the soft keyboard is hidden

Solve the situation that black blocks appear briefly when the soft keyboard is hidden

When I was working on a project, there were many Edittexts in an interface, and a short black block appeared when the soft keyboard of the input method was hidden. Because the layout of this interface was complicated, I thought it was because of the complex interface that caused the stuck phenomenon. phenomenon,

<activity
            android:name="caro.automation.modify.ModifyRoomData"
            android:configChanges="keyboard|keyboardHidden|orientation"
            android:windowSoftInputMode="adjustPan" />

"stateUnspecified" The state of the soft keyboard (whether it is hidden or visible) is not specified. The system will choose an appropriate state or theme-dependent setting. This is the default setting for software disk behavior.

The "stateUnchanged" softkeyboard is kept regardless of its last state, whether it was visible or hidden, when the main window came to the front.

"stateHidden" When the user selects this Activity, the soft keyboard is hidden -- that is, when the user determines to navigate to this Activity, rather than returning to it by leaving another Activity.

The "stateAlwaysHidden" soft keyboard is always hidden when the Activity main window gets focus.

The "stateVisible" softkeyboard is visible when that is normal and appropriate (when the user navigates to the Activity main window).

"stateAlwaysVisible" When the user selects this Activity, the soft keyboard is visible -- that is, when the user determines to navigate to this Activity, rather than returning to it by leaving another Activity.

"adjustUnspecified" It is not specified whether the Activity's main window is resized to make room for the soft keyboard, or whether the contents of the window are visible with the current focus on the screen. The system will automatically choose one of these modes depending on whether the contents of the window have any layout views capable of scrolling their contents. If there is such a view, the window will be resized, assuming that the content of the scrolling window will be visible in a smaller area. This is the default behavior of the main window.

"adjustResize" The Activity's main window is always resized on the screen to make room for the soft keyboard.

"adjustPan" The main window of the Activity does not adjust the size of the screen to make room for the soft keyboard. Instead, the content of the current window will automatically move so that the current focus is never covered by the keyboard and the user can always see the part of the input content. This is generally less desirable than resizing, as the user may close the soft keyboard in order to gain interaction with the overlaid content.


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325855096&siteId=291194637