Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spinner resizes when selecting an item #80

Open
mjanulaitis opened this issue Nov 11, 2016 · 3 comments
Open

Spinner resizes when selecting an item #80

mjanulaitis opened this issue Nov 11, 2016 · 3 comments

Comments

@mjanulaitis
Copy link

If configured in XML to android:layout_width="wrap_content" upon selecting an item control resizes. In my example, the hint is "Age". The values are 1- 100. When I select the number 1 the control resizes. The control should remain a fixed size.

@asadtariq96
Copy link

same problem

@felipecastilhos
Copy link

felipecastilhos commented Mar 24, 2017

I'm with the same problem here, but only when I create the adapter with:

android.R.layout.simple_dropdown_item_1line

If create using simple_spinner_dropdown_item like this:

return new ArrayAdapter<>(context, android.R.layout.simple_spinner_dropdown_item, items);

the size remains the same.

@shahimclt
Copy link

Me too. using android.R.layout.simple_dropdown_item_1line causes this problem. The fix is to use this (as in readme):

ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, brands);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants