定制的自动完成文本视图建议列表 [英] Customized the Suggestion List of AutoComplete Text View

查看:162
本文介绍了定制的自动完成文本视图建议列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是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:dropDownHorizo​​ntalOffset 的android:在布局上的 AutoCompleteTextView dropDownVerticalOffset 或者其他人。见<一href=\"http://developer.android.com/reference/android/widget/AutoCompleteTextView.html\">AutocompleteTextView.

Use the android:dropDownAnchor, android:dropDownHorizontalOffset, android:dropDownVerticalOffset and maybe others on the AutoCompleteTextView in your layout. See AutocompleteTextView.

这篇关于定制的自动完成文本视图建议列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆