Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No suggestion Edit Text with multiline in android

I want to implement Multiline EditText with no suggession in android. I have googled a lot and I found below code :

noticeEditText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

or

noticeEditText.setInputType( android.text.InputType.TYPE_CLASS_TEXT | android.text.InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD );

or

In layout file :

 android:inputType="textFilter"   

But my problem is that, with no suggestion, Edit Text is of single line. I have add below properties also :

noticeEditText.setSingleLine(false);
noticeEditText.setVerticalScrollBarEnabled(true);
noticeEditText.setHorizontalScrollBarEnabled(false);

But still getting single line Edit Text View. What should I do for getting Multiline edit text view with no suggestion.

Thanks.

like image 690
mark Avatar asked Aug 19 '13 05:08

mark


People also ask

How do I turn off edit text on android?

What should I set to disable EditText? It's possible to preserve both the style of the view and the scrolling behaviour. To disable an EditText while keeping this properties, just use UI. setReadOnly(myEditText, true) from this library.

How do you use editable text on android?

If you set android:editable="true" you can access the TextView via the D-pad, or you could add android:focusableInTouchMode="true" to be able to gain focus on touch. The problem is you cannot modify the existing text, and you cannot move the cursor. The text you write just gets added before the existing text.

How do I change the style of edit text in android Studio?

You can use the attribute style="@style/your_style" that is defined for any widget. The attribute parent="@android:style/Widget. EditText" is important because it will ensure that the style being defined extends the basic Android EditText style, thus only properties different from the default style need to be defined.


1 Answers

Try this and you will be happy:

android:inputType="textFilter|textMultiLine|textNoSuggestions"

It should work for you well.

like image 81
Marek Avatar answered Oct 03 '22 01:10

Marek