TextView无法更改AutoCompleteTextView DropDownListVIew中的行 [英] TextView can't change line In AutoCompleteTextView DropDownListVIew
本文介绍了TextView无法更改AutoCompleteTextView DropDownListVIew中的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Android Api 28上进行了测试.
I tested on Android Api 28.
我添加了一个AutoCompleteTextView,它显示如下:
I added a AutoCompleteTextView and it showed like below:
我尝试过:
1.设置行= 3,maxLines = 3,scrollHorizontally = true,inputType ="textMultiLine",singleLine = true,并且未做任何更改.
1.setting lines =3,maxLines = 3,scrollHorizontally = true,inputType="textMultiLine",singleLine =true,and it made no change.
2.设置LayoutParams,如下图所示:
2.setting LayoutParams,and it showed like below:
.
类似情况:自动完成文本视图的文本视图以单行显示数据
推荐答案
只需要一个LinerLayout即可将TextView包装在项目的布局中:
Just need a LinerLayout to wrap the TextView in the layout of item:
<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>
这篇关于TextView无法更改AutoCompleteTextView DropDownListVIew中的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文