Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/209.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 在自动完成视图中设置背景_Android - Fatal编程技术网

Android 在自动完成视图中设置背景

Android 在自动完成视图中设置背景,android,Android,如何将图像设置为AutoMLETE列表的背景 <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="10dp"

如何将图像设置为AutoMLETE列表的背景

    <?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dp"
    android:textSize="16sp"
    android:textColor="#000">
</TextView>

AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autocomplete_friends);
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.list_item, friendsListNameOrder);
    textView.setAdapter(adapter);

AutoCompleteTextView textView=(AutoCompleteTextView)findViewById(R.id.autocomplete\u friends);
ArrayAdapter=新的ArrayAdapter(此,R.layout.list\u项,friendsListNameOrder);
setAdapter(适配器);

谢谢

在xml中为TextView设置背景属性:

<TextView android:background="@drawable/your_img" ... other attributes />

这可能会帮助其他人!。。我想你要找的是:

textView.setDropDownBackgroundResource();  


我想设置包含文本视图的页面背景…没有下拉列表背景。我不明白你想做什么?如果您想更改TextView的背景,请按照我在回答中指出的方式进行,如果您想更改其他内容的背景,请设置另一个视图的
android:background
属性。试着更好地澄清你的问题?你从未在android中使用过AutoComplete texview?他试图询问如何设置AutoCompleteListView的背景,当用户开始键入任何内容时,该背景将被打开。
searchBox.setDropDownBackgroundDrawable();