Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the size of an AutoCompleteTextView Result?

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

enter image description here

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

like image 294
zobi8225 Avatar asked Apr 04 '11 13:04

zobi8225


2 Answers

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" />

and in your code use this

AutoCompleteTextView etChoose= (AutoCompleteTextView) findViewById(R.id.etChoose);
ArrayAdapter<String> adapterChoose = new ArrayAdapter<String>(this,R.layout.dropdown, ChooseList);
like image 144
Hossein Mansouri Avatar answered Sep 21 '22 06:09

Hossein Mansouri


Just add android:dropDownHeight="size" for AutoCompleteTextView in xml file.

like image 23
i.n.e.f Avatar answered Sep 18 '22 06:09

i.n.e.f