如何在软键盘上删除多余的空格 [英] How to remove extra spaces on softkeyboard

查看:97
本文介绍了如何在软键盘上删除多余的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何删除软键盘的 top 空间/边距.

I would like to know how to remove the top space/margin of a soft-keyboard.

要获得更清晰的图片,请查看以下屏幕截图:

For clearer picture, checkout the following screenshots:

有空格但无空格:

推荐答案

您看到的间隔"是自动填充建议区域.如果您将输入类型设置为像text这样简单的内容,那么您将从键盘上获得建议.在inputType字段中添加 textNoSuggestions 将会删除建议区域.

The "spacing" you're seeing is the autocomplete suggestion area. If you have an input type set to something as simple as text then you're going to get suggestions from the keyboard. Adding textNoSuggestions to your inputType field will remove the suggestions area.

例如:

<EditText android:id="@+id/username_field"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:inputType="textNoSuggestions"
    android:hint="@string/username" />

或者如果您已经在使用textCapWords之类的东西,则可以将它们组合如下:

Or if you were already using something like textCapWords you can combine them like so:

<EditText android:id="@+id/username_field"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:inputType="textCapWords|textNoSuggestions"
    android:hint="@string/username" />

此外,不确定是否正在使用它,而只是一个提示,您将需要在密码字段中使用inputType="password".

Also, not sure if you are using it but just a heads up, you'll want to use inputType="password" for your password field.

这篇关于如何在软键盘上删除多余的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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