显示软键盘时向上移动布局? [英] Move layouts up when soft keyboard is shown?

查看:39
本文介绍了显示软键盘时向上移动布局?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在相对视图中有几个元素,设置了底部对齐属性,当软键盘出现时,这些元素被软键盘隐藏.

I have a few elements in a RelativeView with the align bottom attribute set, when the soft keyboard comes up the elements are hidden by the soft keyboard.

我希望它们向上移动,以便在有足够的屏幕空间时将它们显示在键盘上方,或者使键盘上方的部分可滚动,以便用户仍然可以看到元素.

I would like them to move up so that if there is enough screen space they are shown above the keyboard, or to make the section above the keyboard scrollable so the user can still see the elements.

关于如何解决这个问题的任何想法?

Any ideas on how to approach this?

推荐答案

是的,请查看 Android 开发者网站上的这篇文章 描述了框架如何处理软键盘的出现.

Yes, check out this article on the Android developers' site which describes how the framework handles the soft keyboard appearing.

android:windowSoftInputMode 属性可用于指定在每个活动的基础上发生的事情:布局是否调整大小或是否滚动等.

The android:windowSoftInputMode attribute can be used to specify what happens on a per-activity basis: whether the layout is resized or whether it scrolls etc.

这篇关于显示软键盘时向上移动布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆