如何设置 AutoCompleteTextView 结果的大小? [英] How to set the size of an AutoCompleteTextView Result?

查看:33
本文介绍了如何设置 AutoCompleteTextView 结果的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何设置 AutoCompleteTextView 结果的大小吗?

Does anybody know How to set the size of an AutoCompleteTextView Result ?

我尝试了 android:textSize="12sp" 但它只修改 TextView 中文本的大小,而不修改结果.

I try android:textSize="12sp" But it only modify the size of the text in the TextView, not in the result.

推荐答案

最好的方法是使用自定义设计创建自己的 xml 文件,例如dropdown.xml"

The best way is to create your own xml file with a customized design, such as "dropdown.xml"

<?xml version="1.0" encoding="utf-8"?>
<TextView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/textAutoComplete"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#F3F5E1"
    android:gravity="center_vertical"
    android:padding="5dp" />

在你的代码中使用这个

AutoCompleteTextView etChoose= (AutoCompleteTextView) findViewById(R.id.etChoose);
ArrayAdapter<String> adapterChoose = new ArrayAdapter<String>(this,R.layout.dropdown, ChooseList);

这篇关于如何设置 AutoCompleteTextView 结果的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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