react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.51k stars 289 forks source link

Set backgroundColor on Android's dialog #268

Open AlexandreMouyen opened 3 years ago

AlexandreMouyen commented 3 years ago

Hello there,

Is there a way to change Android's dialog backgroundColor ?

I already tried tons of styles, nothing is working...

Thanks a lot.

janrozic commented 3 years ago

It worked with style prop (backgroundColor) up to version 1.11. It got changed (but not documented?) in version 1.12. See here: https://github.com/react-native-picker/picker/blob/5a4ba06be462f834fcd6e26ad3098b3e2528bcb6/js/PickerAndroid.android.js#L170 Use prop backgroundColor (not in style, but its own prop). Unfortunaltely, TS types and documentation were not updated to reflect this change. This works:

<Picker ... backgroundColor="blue">...</Picker>

but TypeScript will not recognize it.

afonso-tsx commented 3 years ago

This didn't work for me @janrozic

minhtet-BeeComTech commented 3 years ago

This didn't work dialog background for me too @janrozic & @afonsopbarros

Screen Shot 2021-07-29 at 7 55 46 PM
dunkbing commented 3 years ago

Does anyone have solutions yet?

LucasHimelfarb commented 2 years ago

really? This library dont support backgroundColor?

vijaykumariorbit commented 1 year ago

I am also facing the same issue. Wanted to have White colour background Dialog box for Dark theme Android and Not able to do that.

softov commented 1 year ago

Any news on that?

I tried styling, background only apply to items, giving a white space on top and bottom.

Nantris commented 11 months ago

Wanted to have White colour background Dialog box for Dark theme Android and Not able to do that.

I want to have a dark dialog box for dark theme on Android and I can't do that... How's that for irony?