我在EditText字段中设置了最大文本长度.
<EditText
android:id="@+id/courseDescriptionField"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:lines="5"
android:maxLength="@integer/max_course_description_limit"
android:gravity="left|top" >
</EditText>
Run Code Online (Sandbox Code Playgroud)
然而,问题是,文本STOPS出现在140个字符之后,但它仍然继续输入,除了文本没有出现,但是,它确实出现在"缓冲区"(意思是建议事物)中这就是你所说的.
作为旁注,我使用TextWatcher来跟踪限制.有没有办法完全限制文本的数量,所以当有140个字符时,按下退格/删除以外的其他内容时没有任何反应?
我想在有人使用我的应用程序时(仅在某些情况下Activities)关闭在软/虚拟键盘上显示"推荐的单词" .对于默认的Android键盘,可以在"设置"下找到(在"词建议设置"下).
有没有办法只在你的应用程序中禁用它,而不需要用户手动去做呢?我基本上希望用户输入单词而不提供任何提示.
谢谢!
我试图禁用对于给定的预测性文本EditText,为解释这里,但是我还是通过预测自动完成...
我有一个支持XT9的三星Galaxy S.
有人可以帮忙吗?
<EditText
android:id="@+id/search_field"
android:layout_width="300dp"
android:layout_height="27dp"
android:background="@drawable/bg_searchfield"
android:hint="@string/search_hint"
android:imeOptions="actionSearch"
android:inputType="text|textNoSuggestions|textFilter"/>
Run Code Online (Sandbox Code Playgroud) 我有这个代码:
AutoCompleteTextView et = new AutoCompleteTextView(context);
et.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
Run Code Online (Sandbox Code Playgroud)
使用此代码AutoCompleteTextView可防止退格键工作!如果我将类类型更改为EditText,则会发生相同的行为.
但是使用此代码,退格键可以工作:
AutoCompleteTextView et = new AutoCompleteTextView(context);
et.setInputType(InputType.TYPE_CLASS_TEXT);
Run Code Online (Sandbox Code Playgroud)
我不想要键盘的自动建议,这就是我使用AutocompleteTextView的原因!有什么建议?
我正在测试Android 2.3.
简短而甜蜜:关于EditText ,我不知道textVisiblePassword和之间有什么区别。根据文档,是“应该可见的密码文本”,其中密码是无用的“密码文本”。 textinputTypetextVisiblePassword
有什么不同?为什么要使用 textVisiblePassword?