I'm trying to figure out how to change the default white background
from a spinner. I've tried a couple of things and looked around on
this newsgroup and elsewhere online. There have been a few related
questions, but I haven't deduced the answer yet (maybe I just didn't
understand what I've read). Am I on the right track or waay off?

Here is what I've got so far:

spinner = (Spinner)findViewById(R.id.spinner);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
R.layout.spinner_item, data);
adapter.setDropDownViewResource(R.layout.spinner_dropdown);
spinner.setBackgroundDrawable(null);
spinner.setAdapter(adapter);

This does what you would expect - it hooks up the Spinner and
spinner.setBackgroundDrawable(null) removes the background from the
unfocused view.

However, I can't figure out how to remove the white background shown
when you click on the Spinner and it to "pops up".

I figured this might be possible by setting the background of the
spinner_dropdown TextView by using an empty/transparent PNG as a
background:

<TextView xmlns:android="http://schemas.android.com/apk/res/android";
    android:singleLine="true"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/empty"/>

This does set the background of an individual row, but it seems there
is another View wrapping all the rows that is drawing the white
background.

How can I eliminate or replace the default white background from the
wrapping view?

Or... have I misinterpreted the situation? Is there a preferred way to
style a Spinner?

Thanks!




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to