Android spinner dropdown menu background color change

19,119

Solution 1

Yep, it's possible. Use android:popupBackground on the Spinner in your XML or setPopupBackgroundResource(int) in code.

Solution 2

To change the background color of the drop-down list, add android:colorBackground parameter to the theme in your styles.xml

Code:

<style name="AppTheme" parent="Theme.AppCompat.Light">
    <item name="android:colorBackground">#ff0000</item>
</style>

Thus, the overall style is preserved: the effect when pressed, rounded corners, etc.

Screenshot:

enter image description here enter image description here

Share:
19,119
Muayad Salah
Author by

Muayad Salah

I am working for the international company well known in the PCB manufacturing software called Frontline-PCB. I had the change to work on their fresh Big-Data project. I got to work with these technologies: - Java Spring Boot - NoSQL document-based database MongoDB - Deployment orchestration with Docker and Docker Swarm - Big-Data technologies of Hadoop Ecosystem. Like HDFS, Spark, Flume, Impala, Kafka, Oozie, Yarn and more. And I got to learn many subjects like: - New design architecture, like Lambda architecture. - Microservices design and deployment. With Netflix's components like Zuul, Eureka, Ribbon, Feign and also the basic starter projects of Spring Boot like Spring Data, and Spring Security. - Basic level of new front-end technologies like Angular, React and Vue. - Cloud deployment on EC2 and Oracle Cloud.

Updated on June 05, 2022

Comments

  • Muayad Salah
    Muayad Salah about 2 years

    I want to change a spinner's dropdown menu background color without changing the background color of the spinner itself (it's transparent). Is it possible?