Android键盘阻止EditText [英] android keyboard blocking EditText

查看:119
本文介绍了Android键盘阻止EditText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在EditText控件获得焦点之后,软键盘将显示,如果该控件位于屏幕的一半以下,则键盘将阻止其允许用户输入.

After an EditText control gets focus, the soft keyboard displays, if the control is below half of the screen, the keyboard will block it from allowing user to input.

我做了一些搜索,在AndroidManifest.xml文件中为该活动添加windowSoftInputMode(都尝试了AdjustPan和AdjustResize)将解决阻塞问题,但是所有输入控件看起来都很糟糕,例如,单行文本将具有灰色背景,黑色边框和单选按钮的内部将具有深色的粗边框和绿色,并且聚焦的多行EditBox将具有完整的黑色背景.

I did some search, adding windowSoftInputMode (both tried adjustPan and adjustResize) for the activity in the AndroidManifest.xml file will solve the blocking issue, but all input controls look awful, e.g., the single line text will have gray background and black border, and radio button will have dark thick border and green inside, and the focused multi line EditBox will have complete black background.

任何解决方法的想法(不阻止输入,并且没有那些糟糕的控件.)

Any idea how to solve the issue (not blocking input and without those awful controls.)

  1. "Theme.Holo.Light.NoActionBar"作为默认主题.
  2. Android 4.1.x

推荐答案

尝试在清单中的活动标记内使用以下行.会起作用的.

Try using the following line in your manifest inside the activity tag. It will work.

<activity
    android:name="Your activity name"
    android:windowSoftInputMode="adjustPan"/>

即使有任何问题,也可以使用scrollview.

Even then if any problem, you can use scrollview along with this.

这篇关于Android键盘阻止EditText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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