全屏模式似乎会导致不同的 softInputMode 行为
似乎当 Activity 处于全屏模式时,softInputMode 似乎不会调整底层视图以实现所需的向上滚动行为。在 onCreate(...) 内:
setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);
super.onCreate(savedInstanceState);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE|WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
视图结构由滚动视图和相对布局内的线性布局组成。这个想法是,线性布局创建一个“按钮栏”,该按钮栏应该绑定到窗口底部,但向上移动以保持在键盘上方。当未设置全屏模式时,这可以正常工作,但当添加上面的第一行时就不行了。
有什么想法吗?
谢谢!
It seems that when the Activity is in fullscreen mode, it seems that the softInputMode does not adjust the underlying views for the desired scroll up behavior. Within onCreate(...):
setTheme(android.R.style.Theme_NoTitleBar_Fullscreen);
super.onCreate(savedInstanceState);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE|WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
The view structure consists of a scroll view and a linear layout within a relative layout. The idea is that the linear layout makes a "button bar" that should be tied to the bottom of the window, but move up to stay above the keyboard. When full screen mode is not set, this works OK, but not when the first line above is added.
Any ideas?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论