【发布时间】:2013-05-02 04:26:21
【问题描述】:
我想知道如何删除软键盘的顶部空格/边距。
为了更清晰的图片,请查看以下屏幕截图:
有空格和无空格:
【问题讨论】:
-
您的用户名和密码字段的输入类型是什么?
-
@MCeley 好的,我想我明白你的意思了 :) 我将重新配置 EditText 选项。感谢指导!
标签: android margin android-softkeyboard
我想知道如何删除软键盘的顶部空格/边距。
为了更清晰的图片,请查看以下屏幕截图:
有空格和无空格:
【问题讨论】:
标签: android margin android-softkeyboard
您看到的“间距”是自动完成建议区域。如果您将输入类型设置为像text 这样简单的东西,那么您将从键盘获得建议。将textNoSuggestions 添加到您的inputType 字段将删除建议区域。
例如:
<EditText android:id="@+id/username_field"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textNoSuggestions"
android:hint="@string/username" />
或者,如果您已经在使用 textCapWords 之类的东西,您可以像这样组合它们:
<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" 作为您的密码字段。
【讨论】:
无论您的inputType 是什么,请在其末尾添加|textNoSuggestions。
【讨论】: