Search code examples
androidjquerycordovamobileselect-menu

Strange light green background color for selected option in selectmenu jquery mobile and cordova 4 cli


Please see the screenshot on the link below.

i'm using selectmenu from jquery mobile and building the app for android in cordova CLI , the select menu selected option has a strange green color background, i tried the following css without any result:

* {
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important; 
    -webkit-tap-highlight-color: transparent !important; 
}

select option {
    background-color:#ffffff !important;    
}

select option:checked {
    background-color:#ffffff !important;    
}

I was not facing this problem when i was using the "phonegap build" with phonegap 3.6 version.

I don't think the problem is in css, it might be from cordova build?

I have faced this problem also for data-native-menu= "false"

Screenshot link: https://drive.google.com/file/d/0B2nIP5MeGtfPWmtMT2JabkN2Tm8/view?usp=sharing


Solution

  • I've been having a similar problem, but found a solution in this answer:

    https://stackoverflow.com/a/18170978

    It looks like the green styling of the select menu is controlled by the default theme specified in the AndroidManifest.xml.

    Changing it to

    android:theme="@android:style/Theme.DeviceDefault"

    fixed it for me.