текстовое представление autocompletetextview, показывающее данные в одной строке

Я получаю текстовое представление моего автозаполнения, похожее на изображение (http://1.bp.blogspot.com/_I2Ctfz7eew4/S-fuCsktkaI/AAAAAAAAAZw/31QDXkXQ_Yc/s1600/AutoCompleteTextView2.1.PNG). Я хочу, чтобы высота текстового представления увеличивалась, когда длина текста выходит за пределы ширины.

Мой код автозаполнения текста:

<AutoCompleteTextView 
             android:layout_width="0dip"
            android:layout_weight="3.5"
            android:layout_height="40dp"
            android:ems="10"
            android:padding="5dp"
            android:imeOptions="actionNext"
            android:layout_marginLeft="7dp" 
            android:background="@drawable/edittext_frame"
            android:textSize="16dp"
/>

Мой код Textview

<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    style="?android:attr/spinnerItemStyle"
    android:layout_width="50dp"
    android:layout_height="wrap_content"
    android:paddingTop="8sp"
    android:paddingBottom="8sp"
    android:gravity="center_vertical"
    android:textSize="14sp">
</TextView>

person Sagar Pawar    schedule 16.12.2014    source источник
comment
Вы забыли код? я ничего не вижу   -  person Nanis    schedule 16.12.2014
comment
Теперь вопрос в порядке   -  person Sagar Pawar    schedule 16.12.2014
comment
Добавьте это в свой TextView: android:layout_height=wrap_content android:inputType=textMultiLine   -  person Nanis    schedule 16.12.2014


Ответы (1)


Просто используйте LinearLayout для переноса TextVidw:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/tv_search"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="4dp"
    android:paddingBottom="4dp"
    android:singleLine="false"
    android:textColor="#000000"
    android:textSize="16dp"
    tools:text="test--------------------------------------test" />
 </LinearLayout>

мой вопрос

person tiny sunlight    schedule 30.06.2020