Shudy
Shudy

Reputation: 7936

Convert EditText in a "spinner"

In the work they asked me to do a activity like that:

enter image description here

And the "category" when clicked has to show a list of categories. but, they want as the same look and feel as a edittext.

How can I do it, without to be a spinner? Is there any option? or that functionallity must be a spinner?

Upvotes: 0

Views: 1035

Answers (2)

Paul Lammertsma
Paul Lammertsma

Reputation: 38252

I would suggest replacing your layout's EditText with a AutoCompleteTextView.

Example of AutoCompleteTextView

You can then provide a list adapter much in the same way as you would provide an adapter into a Spinner:

mAutoCompleteTextView.setAdapter(suggestions);

Upvotes: 3

user543
user543

Reputation: 3633

Use spinner only. But change the background of spinner with the custom background Like editText background with that right arrow.Take that background from ur graphic designers.

<Spinner android:id="@+id/categories"
android:background="@drawable/custombackground"/>

Upvotes: 0

Related Questions