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.
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.
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.
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.
Try this and you will be happy:
android:inputType="textFilter|textMultiLine|textNoSuggestions"
It should work for you well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With