roberthovhannisyan / PhoneGap-Plugin-ListPicker

ListPicker Plugin for Cordova/PhoneGap (iOS and Android)
MIT License
35 stars 40 forks source link

IOS Dark Mode Compatibility Issue - Dropdown items not visible #29

Open Shanupa opened 4 years ago

Shanupa commented 4 years ago

In IOS Dark Mode, the dropdown items are not visible. We can see poor visible text. In Light Mode its working fine. Any fix regarding this issue ?

Shanupa commented 4 years ago

Can you help on this ?

maurisor commented 3 years ago

Hi guys,

I solved this issue by replacing the line 86 in the ListPicker.m file with this piece of code: if (@available(iOS 12.0, *)) { switch (UIScreen.mainScreen.traitCollection.userInterfaceStyle) { case UIUserInterfaceStyleDark: [view setBackgroundColor:[UIColor colorWithRed:0.22 green:0.22 blue:0.22 alpha:1.0]]; break; case UIUserInterfaceStyleLight: case UIUserInterfaceStyleUnspecified: [view setBackgroundColor:[UIColor colorWithRed:0.97 green:0.97 blue:0.97 alpha:1.0]]; break; default: break; } }

That basically check if the Darkmode is enabled and set the background color of the picker black or white