Problem - Trying to do: I've been unsuccessfully trying to get lengthy items in a drop down list to wrap. I really wasn't sure it is possible. I have a drop down list with question options, which can be long in a few cases.
What I have tried: I've created a custom TextView
layout for the adapter used to populate the AutoCompleteTextView
. I've tried the usual and combinations of wrap-content
, android:singleLine=false
, android:lines="2"
without any success. I really thought someone has probably tried this before
Layout
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="25dp"
android:padding="5dp"
android:singleLine="false"
style="@style/MyDropDownTheme"
android:id="@+id/text1" android:hint="@string/hint_type">
</TextView>
ArrayAdapter
ArrayAdapter questions = new ArrayAdapter<>(context, R.layout.custom_drowdown_list_wrap, orgQuestions);
question.setAdapter(questions);