arcadefire / nice-spinner

A nice spinner for Android
Apache License 2.0
2.84k stars 446 forks source link

PopupMenu Background color #146

Closed mrtarunsaraswat closed 2 years ago

mrtarunsaraswat commented 4 years ago

How can I change the popup menu background color? By default it is white.

tachyonlabs commented 4 years ago

Having just done this myself, you use the backgroundSelector attribute. For example, in the drawable directory I created a file spinner_background_selector.xml with contents of

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorDayNightSpinnerBackground" />
</selector>

and in my layout file added this attribute to the spinners: app:backgroundSelector="@drawable/spinner_background_selector"

ColdSongDvl commented 4 years ago

If there are two NiceSpinners in the ui and use this property, it will cause arrow confusion