Android 在自动完成视图中设置背景
如何将图像设置为AutoMLETE列表的背景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"
<?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();