0

我在 Android Api 28 上进行了测试。

我添加了一个 AutoCompleteTextView,它显示如下:

错误

我尝试过:

1.设置lines = 3,maxLines = 3,scrollHorizo​​ntally = true,inputType="textMultiLine",singleLine =true,没有变化。

2.设置LayoutParams,如下图:

设置布局参数.

类似情况:autocompletetextview 的 textview 以单行显示数据

4

1 回答 1

0

只需要一个 LinerLayout 将 TextView 包装在项目的布局中:

<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>
于 2020-06-30T08:34:47.377 回答