问题描述
这是code我AutoCompleteTextView:
This is the code for my AutoCompleteTextView :
String[] countries = getResources().getStringArray(R.array.countries_array);
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.item_list ,countries);
textView = (AutoCompleteTextView) dialog.findViewById(R.id.autoCompleteTextView1);
adapter.setNotifyOnChange(true);
textView.setAdapter(adapter);
这是item_list:
This is item_list :
<?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="wrap_content"
android:padding="10dp"
android:textSize="16sp"
android:textColor="#000"
android:drawableRight="@drawable/arrow">
和此是输出:
我想改变这个弹出样意见箱,并希望从AutoCompleteTextView显示下方一点点建议列表..similar这样:(请忽略了苹果的设计,只是在哪里,结果出现)
I want to change this pop-up kind of suggestion box , and want to show the suggestion list a little bit below from the AutoCompleteTextView ..similar to this : (please disregard the apple design, it’s just about where the results appear)
我怎样才能做到这一点..Please建议。
谢谢!
How can i do this ..Please suggest .Thanks.!!
推荐答案
使用的android:dropDownAnchor
,的android:dropDownHorizontalOffset
,的android:在布局上的
或者其他人。见AutocompleteTextView. AutoCompleteTextView
dropDownVerticalOffset
Use the android:dropDownAnchor
, android:dropDownHorizontalOffset
, android:dropDownVerticalOffset
and maybe others on the AutoCompleteTextView
in your layout. See AutocompleteTextView.
这篇关于定制的自动完成文本视图建议列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!