0

The layout of my spinner while close is adopting the layout of the layout configured to each row of the spinner.

The layout for each row is defined inside getCustomView method because I am using a custom adapter to the spinner, here it is define:

public View getCustomView(int position, View convertView, ViewGroup parent) {

            LayoutInflater inflater=getLayoutInflater();
            View row=inflater.inflate(R.layout.row, parent, false);  //here is the layout for each row -> R.layout.row

            //there are more things here but doesnt matter for the question..


}

On that layout (row.xml) I have margins top and bottom, because I want to give soem space between the choices.. But then the button itself of the spinner, I mean, the layout of the spinner while closed also has the margins.. and it looks larger than what I want.

It is possible to define different layouts? I tryed to make the spinner layout at xml using less height, but then I can see the option clearly.. because it has margins..

Did I make myself clear? Thanks alot in advance.. If someone didnt understand I can explain better. Thanks ;)

TiagoM
  • 3,458
  • 4
  • 42
  • 83
  • found the solution here: http://stackoverflow.com/questions/4647299/android-spinner-with-different-layouts-for-drop-down-state-and-closed-state – TiagoM Mar 28 '13 at 21:15

1 Answers1

0

Finnaly found a solution to this problem :) Didn't know that getDropDownView was for the dropdown layout and the getView was for the single layout, at closed spinner...

Solution here: Android Spinner with different layouts for "drop down state" and "closed state"?

Community
  • 1
  • 1
TiagoM
  • 3,458
  • 4
  • 42
  • 83