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.)
- "Theme.Holo.Light.NoActionBar"作为默认主题.
- 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.