android:返回活动后未显示软键盘,布局保持平移
我的活动被平移,以便为软键盘腾出空间(键盘可见)。
当我通过按主页按钮使活动处于此状态时,返回此活动后,布局保持平移,但不显示键盘。 我希望在这种情况下显示键盘,或者向下滑动布局。有人可以帮我吗,该怎么做?
我不想使用 android:windowSoftInputMode="stateVisible"
因为我不希望默认显示键盘。
My activity is panned in order to make space for soft keyboard(keyboard is visible).
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?
I don't want to use android:windowSoftInputMode="stateVisible"
because I don't want keyboard to be shown by default.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所以全屏活动肯定存在一些问题。当我将活动从全屏更改为例如 NoTitleBar 时,一切正常。
使用全屏活动时,目标是在 onRestart 方法中强制重绘/重新测量屏幕。
对于全屏活动的此问题,我在此处找到了解决方法< /a>
So there must be some problem with fullscreen activities. When I change my activity from fullscreen to for example NoTitleBar, everything works fine.
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
当你想显示键盘时,你可以尝试这段代码:
You can try this piece of code when you want to show the keyboard :