开发者

EditText.setError() on single line

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜