我在 Android Api 28 上进行了测试。
我添加了一个 AutoCompleteTextView,它显示如下:
我尝试过:
1.设置lines = 3,maxLines = 3,scrollHorizontally = true,inputType="textMultiLine",singleLine =true,没有变化。
2.设置LayoutParams,如下图:
我在 Android Api 28 上进行了测试。
我添加了一个 AutoCompleteTextView,它显示如下:
我尝试过:
1.设置lines = 3,maxLines = 3,scrollHorizontally = true,inputType="textMultiLine",singleLine =true,没有变化。
2.设置LayoutParams,如下图:
只需要一个 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>