添加的EditText不是TextInputEditText.请改用该类 [英] EditText added is not a TextInputEditText. Please switch to using that class instead
问题描述
我在TextInputLayout
中使用了EditText
,但是将支持库升级到23.2.0之后,我在logcat中收到此警告,常规EditText
和TextInputEditText
有什么区别? ?我似乎找不到任何文档.
I'm using an EditText
inside a TextInputLayout
, but after upgrading the support library to 23.2.0, I get this warning in the logcat, What's the difference between a regular EditText
and a TextInputEditText
? I can't seem to find any documentation for it.
推荐答案
我也想知道, Daniel Wilson 聚集了文档,但是对于未经培训的人来说,意义不大.这就是全部内容:提取模式" 指的是当空间太小(例如手机上的风景)时显示的视图类型.我正在将Galaxy S4和Google Keyboard用作输入法编辑器(IME).
I was wondering this too, Daniel Wilson gathered the documentation, but to the untrained eye it doesn't mean much. Here's what it's all about: "extract mode" is referring to the type of view that's shown when the space is too small, for example landscape on a phone. I'm using Galaxy S4 with Google Keyboard as input method editor (IME).
基于焦点(在Description上),您可以看到TextInputLayout
的实际操作将提示推到了编辑器之外.没什么特别的,这就是TextInputLayout
应该做的.
Based on the focus (on Description) you can see TextInputLayout
in action pushing the hint outside the editor. Nothing special here, this is what TextInputLayout
is supposed to do.
编辑名称,您会看到IME并没有提示您正在编辑什么.
Editing the Name you can see that the IME doesn't give you a hint of what you're editing.
编辑说明,您会看到IME提示您正在编辑什么.
Editing the Description you can see that the IME gives you a hint of what you're editing.
两个字段之间的区别是它们的类型EditText
VS TextInputEditText
.重要的是,TextInputLayout
具有android:hint
而不是包装的EditText,当TextInputEditText
的几行Java代码产生很大差异时,就是这种情况.
The difference between the two fields is their type EditText
VS TextInputEditText
. The important thing here is that TextInputLayout
has the android:hint
and not the wrapped EditText, this is the case when TextInputEditText
's few lines of Java code makes a big difference.
<android.support.design.widget.TextInputLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Item Name"
>
<EditText
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
</android.support.design.widget.TextInputLayout>
说明字段
<android.support.design.widget.TextInputLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Item Description"
>
<android.support.design.widget.TextInputEditText
android:id="@+id/description"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="textMultiLine"
android:minLines="4"
android:scrollbars="vertical"
/>
</android.support.design.widget.TextInputLayout>
这篇关于添加的EditText不是TextInputEditText.请改用该类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!