开发者

EditText.setError() on single line

开发者 https://www.devze.com 2023-03-25 18:11 出处:网络
I have a question about EditText.setError(). I have an EditText : 开发者_Python百科 <TextView android:id=\"@+id/sc_num\"

I have a question about EditText.setError().

I have an EditText :

开发者_Python百科
<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"/>

I want to display the error message "please enter a valid security code" using the setError() method.

When I run the app I'm getting an error displayed in multiple lines as shown in the picture

EditText.setError() on single line

What would I do to display this error in single line?


Try android:scrollHorizontally="true".

EDIT: Use android:SingleLine="true".

0

精彩评论

暂无评论...
验证码 换一张
取 消