机器人:恢复活动后softkeyboard未显示,布局保持平移机器人、布局、softkeyboard

2023-09-12 06:09:21 作者:残花泽

我的活性被平移以使软键盘空间(键盘是可见的)。

My activity is panned in order to make space for soft keyboard(keyboard is visible).

当我离开的活动在此状态下通过pressing home键,返回到本次活动后,布局保持平移,但键盘不显示。 我很乐意被显示在这种情况下键盘,或布局滑下去。有人可以请帮我,怎么办?

When I leave activity in this state by pressing home button, after return to this activity, layout remains panned, but keyboard is not shown. I'd love keyboard to be shown in this situation, or layout to slide down. Can somebody please help me, how to do that?

我不希望使用机器人:windowSoftInputMode =stateVisible,因为我不想键盘默认显示

I don't want to use android:windowSoftInputMode="stateVisible" because I don't want keyboard to be shown by default.

推荐答案

所以肯定会有一些问题,全屏活动。当我改变我的活动从全屏到例如NoTitleBar,一切工作正常。

So there must be some problem with fullscreen activities. When I change my activity from fullscreen to for example NoTitleBar, everything works fine.

当使用全屏活动时,目标是强制重绘/在onRestart方法重新测量屏幕。 对于这个问题,全屏活动中,我发现了解决方法here

When using fullscreen activities, the goal is to force redraw/remeasure screen in onRestart method. For this issue with fullscreen activities, I found workaround here