react-native-google-places
react-native-google-places copied to clipboard
IOS 13.0+ dark mode displays white text color for openAutocompleteModal queries on a light gray background
Makes the text unreadable in this case. Maybe we could change the background color for the modal depending on theme to support IOS 13.0+?
Thanks!
Can confirm from a TesFlight build: Device: iPhone XR iOS Version: 13.1.3
Looking into things, the SDK for IOS provides properties for controlling display colour, to further @Wmeng98's suggestion, would it make sense to allow control of these properties through the options provided to openAutocompleteModal
ref properties: https://developers.google.com/places/ios-sdk/reference/interface_g_m_s_autocomplete_view_controller.html#properties
Thoughts @tolu360?
Ive been playing around with a solution and am happy to submit PR if it makes sense, though it would be IOS only options as (to my knowledge) the android side would need a custom layout to apply this kind of control.
Happy to PR if it makes sense to add this feature.
I'm having this problem too, with dark mode
I've created PR with solution from https://stackoverflow.com/a/59071909/923497
Can we please have either #267 or #274 merged?
@tolu360 please look at merging either #267 or #274, changes helpful for dark-mode on iOS 13+
What is the status of this issue? Has the PR been merged? Because I'm having the same issue even with the latest version
@MarcoSpeziali looks like it's stuck. But you can use https://www.npmjs.com/package/patch-package, a great tool for patching your node_modules dependencies. Here is a video with a usage example.
Any updates here?
I've created PR with solution from https://stackoverflow.com/a/59071909/923497
Based on this answer, steps to fix
- Open XCode
- Find the file RNGooglePlacesViewController
- Add this to line 38 directly below
GMSAutocompleteViewController *viewController = [[GMSAutocompleteViewController alloc] init];
It should look like
if(UIScreen.mainScreen.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark ){
viewController.primaryTextColor = UIColor.whiteColor;
viewController.secondaryTextColor = UIColor.lightGrayColor;
viewController.tableCellSeparatorColor = UIColor.lightGrayColor;
viewController.tableCellBackgroundColor = UIColor.darkGrayColor;
} else {
viewController.primaryTextColor = UIColor.blackColor;
viewController.secondaryTextColor = UIColor.lightGrayColor;
viewController.tableCellSeparatorColor = UIColor.lightGrayColor;
viewController.tableCellBackgroundColor = UIColor.whiteColor;
}
}```