2013-05-08 75 views
2

我想知道如何删除top软键盘的空白/边距。如何删除softkeyboard上的多余空间


为了更清晰的画面,签出下面的截图:

空间和没有空间:

enter image description hereenter image description here

+1

您的用户名和密码字段的输入类型是什么? – MCeley 2013-05-08 03:38:17

+0

@MCeley好吧我想我明白你的意思:)我将重新配置EditText选项。感谢您的指导! – Roylee 2013-05-08 03:39:45

回答

3

您看到的“间距”是自动填充建议区域。如果您的输入类型设置为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"作为你的密码字段。

+0

+1 @MCeley伟大的信息!我很确定其他人会从你的回答中受益:) – Roylee 2013-05-08 03:49:28

3

无论你inputType是,加|textNoSuggestions到它的结束。

+0

+1这将是答案:)我怎么能忘记这一点,谢谢@kcoppock – Roylee 2013-05-08 03:43:43

相关问题