Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8944669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:04:46+00:00 2026-06-15T12:04:46+00:00

I was trying to change the android spinner popup window background by setting the

  • 0

I was trying to change the android spinner popup window background by setting the android:popupBackground, but it didn’t have any effect. Is there any way I can change it?

    <Spinner
           android:id="@+id/eventNameSpinner"
           android:layout_width="160dp"
           android:layout_height="30dp"
           android:layout_alignParentLeft="true"
           android:layout_centerVertical="true"
           android:layout_marginLeft="6dp"
           android:background="@drawable/btn_name"
           android:paddingBottom="2dp"
           android:paddingTop="2dp"
           android:popupBackground="@drawable/bkg">
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:04:46+00:00Added an answer on June 15, 2026 at 12:04 pm

    I presume you are trying to change the “outer” backgroud of a Spinner’s popup, not the background of Spinner “pupup items”. Also, I presume that by popup, you mean a Spinner’s dialog mode, where a floating dialog window appears on top of your activity, as opposed to the new dropdown mode.

    Strategy

    For a clean, sustainable approach which behaves well across multiple Android platforms and reduces the need for redundancy in the App, I believe it is essential to understand what the official docs don’t tell us. So follow me on a short journey.

    The tricky part about Spinners is that an Adapter is used to connect them to data. While it is relatively easy to identify the hooks for changing the appearance of android.R.layout.simple_spinner_item and its friends, those only determine the style of the Spinner’s currently displayed item as well as each single popup item. But it is the Adapter which is responsible for creating the ListView and other widgets which frame that ListView.

    This complexity is probably the reason why Android has introduced some attributes which can be specified on-the-fly “for” the Spinner although they are then applied to the Spnner’s children, such as android:popupBackground. This is not necessarily a clean approach, rather a limited set of convenience functions. Regarding popupBackground, btw, this was introduced in API level 1, but Spinners respect it only in spinnerMode=dropdown, which was introduced in API level 11. That’s the reason why you’ll never be notified if you use it wrongly.

    Older Android Versions (such as 2.2)

    ListView

    Knowing that the Adapter creates a ListView, it’s not a bad idea to change the ListView appearance in one’s theme, so there’s one single place for the design change and the styling straightforward, like so:

    <style name="MyTheme" parent="@android:style/[reference to original theme]" >
        <item name="android:listViewStyle">@style/myListView</item>
        [...]
    </style>
    
    <style name="myListView" parent="@android:style/Widget.ListView">
        [check Android's Widget.ListView to understand what you can change here]
    </style>
    

    AlertDialog

    Unfortunately, there’s more work ahead. Because android:prompt can be used to create a headline for the popup, the popup really consists of more than just the ListView.

    Android uses an AlertDialog

    Recent Android Versions (such as 4.2)

    Now that the AlertDialogs are styled, we still have to address the fact that more recent versions of Android don’t use AlertDialogs for Spinner dialogs any more. That doesn’t hurt, because for those, the AlertDialog style shouldd be kept anyways. It just means we need to style the new popup as well.

    To do so, create version specific theme XML files to pull the additional styles into your customized theme, and provide version specific style XML files.

    Feel like trying it yourself, starting here?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to change the appearance of an Android Button, but I can't
I'm trying to change orientation of my android emulator. I have tried to use
I'm trying to change the item colors of a listview in android, but I
I have activity with android:configChanges=orientation|keyboardHidden I am trying to change image in ImageView when
I am trying to change the Gtalk Status using XMPPConnection in Android. But when
I am trying to change the background of the app, but when I do
I'm trying to change priority of main thread using android.os.Process.setThreadPriority() . I have log
I'm trying to know whether it is possible to change the default android OS
Possible Duplicate: ToggleButton state change programmatically rather than automatically in Android? I am trying
Am trying to change the button frame according to the orientation change but button

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.