Different spinner textView (solved)

BeginnnnnerBeginnnnner Member ✭✭
edited January 26 in General

Is there a way to change text only in the unrolled spinner? I mean the text that shows the selected option. I need the selected option to be white and smaller... The dropdownmenu will be in black and bigger. (Explained in the picture)

There is one thing I don't really understand and that's why the spinner uses only the first third of it's width? I need to use the extra space which is shown in the picture aswell to see the whole selected word without making the spinner wider.

I tried to change text color and size in spinner properties, but it chages the color and size in the dropdown menu too...

Thanks, tried to find solution everywhere...

Answers

  • BeginnnnnerBeginnnnner Member ✭✭
    edited January 26

    I will answer my problem, because I've found it out, someone might need this in the future.

    You need to create new XML file in the resources.layout folder. Name it for example my_custom_spinner.

    In this XML file you declare how you want the text view to look like.

    After that, when you declare the spinner adapter in Main_Activity.cs, use: var adapter = ArrayAdapter.CreateFromResource(
    this, Resource.Array.STRING_ARRAY, Resource.Layout.MY_CUSTOM_SPINNER);

Sign In or Register to comment.