我有一个问题EditText.setError()
.
我有一个 EditText :
<TextView android:id="@+id/sc_num"
style="@style/textLabel"
android:text="@string/scnum"
android:layout_below="@+id/creditCard"/>
<EditText android:id="@+id/credit"
android:background="@android:drawable/editbox_background"
android:layout_below="@+id/sc_num"
android:layout_alignRight="@+id/state"/>
我想显示错误消息“请输入有效的安全码”
使用setError()
method.
当我运行该应用程序时,我收到多行显示的错误,如图所示
![security code Edit text](https://i.stack.imgur.com/Gbtmc.png)
我该怎么做才能在单行中显示此错误?
Try android:scrollHorizontally="true"
.
EDIT:
Use android:SingleLine="true"
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)