I am trying to setText("long pile of text") of my AutoCompleteTextView with a line separator. When I insert the text it makes it with horizontal scroll. I want to make it in two lines:
"long pile
of text"
\n\r is working fine for the dropdownlist, but when i click the item, it moves it to the AutoCompleteTextView for which \r\n doesn't work
Things i have tried and failed with:
inserting \n, \r\n, System getProperty("line.separator"), in the string
setting values for autocomplete like
android:singleLine="false"
android:lines="2"
android:minLines="2"
android:maxLines="4"
android:scrollHorizontally="false"
this is mine AutoCompleteTextView
<AutoCompleteTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/edtxt_ticket_code"
android:background="@drawable/round_border_gray"
android:layout_gravity="center_horizontal"
android:gravity="center|center_vertical|center_horizontal"
android:hint="Upisi rutu"
android:lines="2"
android:minLines="2"
android:maxLines="4"
android:scrollHorizontally="false"
android:paddingLeft="@dimen/edit_text_padding"
android:paddingRight="@dimen/edit_text_padding"
android:textColor="@color/gray_main"
android:textColorHint="@color/gray_light"
android:textSize="@dimen/text_size_small"/>
Just add this android:inputType="textMultiLine"
Finally ,
android:inputType="textMultiLine"
android:dropDownHeight="fill_parent"
android:dropDownWidth="match_parent"
I hope it will helps you
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