1

This is a very basic question

I'm trying to create a spinner in my android layout. Then i found a website teaching how to create an ArrayAdapter for that spinner

 ArrayAdapter<Giveaway.GiveawayCategory> dataAdapter = new ArrayAdapter<Giveaway.GiveawayCategory>(this, android.R.layout.simple_spinner_item, new ArrayList<Giveaway.GiveawayCategory>(20));
        dataAdapter.add(ImportGiveawayActivity.selectCategory);

        dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        this.spinner.setAdapter(dataAdapter);

it works very fine but there is a giant margin between the items...

So i looked into simple_spinner_dropdown_item and found:

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    style="?android:attr/spinnerDropDownItemStyle"
    android:singleLine="true"
    android:layout_width="match_parent"
    android:layout_height="?android:attr/dropdownListPreferredItemHeight"
    android:ellipsize="marquee"/>

probably the height is not good, or the style sets a huge margin, i tried to find those files but i couldn't

How can i override these values in my style.xml

this is what i want to change enter image description here

Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
  • 1
    Possible duplicate of [How to re size the Height of the Items in Spinner with multiple choice?](https://stackoverflow.com/questions/8878260/how-to-re-size-the-height-of-the-items-in-spinner-with-multiple-choice) – Rajen Raiyarela Dec 23 '18 at 01:08
  • @RajenRaiyarela, the idea is similar but the solution is not what i want... there must be an simplier way to override basic android styles... if the solution was to recreate my own layout and etc i would never ask a question here – Rafael Lima Dec 23 '18 at 02:56

0 Answers0