-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Date Selector Doesn't handle iOS 13 dark mode #87
Comments
Hi there! The current master branch contains new styles for RMDateSelectionController, which automatically adapt to the current environment. In addition, the master branch contains some bugfixes which are not yet available in the latest release. Can you give the master branch a try to see if it improves the situation for you? Best regards, |
Hey Roland! I tried both master and this commit directly 7d3d785, but didn't seem like in either way I was able to theme it black or have have the text show up in Dark mode. var data = message.body as! Dictionary<String, AnyObject>
let date: Date
if let year = data["year"], let month = data["month"], let day = data["day"] {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy,MM,dd"
// Need to add 1 to month, since iOS wants months to start at 1 instead of 0
date = dateFormatter.date(from: "\(year),\((month as! UInt) + 1),\(day)") ?? Date()
} else {
// Fallback to today's date
date = Date()
}
let selectAction = RMAction<UIDatePicker>(title: "Set Date", style: RMActionStyle.done) { controller in
self.setDate(controller.contentView.date)
}
let cancelAction = RMAction(title: "Cancel", style: RMActionStyle.cancel) { _ in
print("Date cancelled")
self.webViewController?.queueDispatchableAction(DispatchableAction(action: "updateDate", payload: nil))
}
let actionController: RMDateSelectionViewController = RMDateSelectionViewController(style: RMActionControllerStyle.black)!
actionController.title = "Select a Date"
// Actions have to be added separately, opposed to in the constructor in order to stack them
actionController.addAction(selectAction! )
actionController.addAction(cancelAction! as! RMAction<UIDatePicker>)
actionController.disableBlurEffects = true
actionController.disableBouncingEffects = true
actionController.datePicker.date = date
actionController.datePicker.datePickerMode = UIDatePicker.Mode.date
self.webViewController!.present(actionController, animated: true, completion: nil) Is how I'm trying to make it black! Thanks, Chris |
The key is that you can't set disableBlurEffects = YES, the default NO works well. |
Hello friend!
We've noticed that on iOS 13 with Dark Mode enabled, the selector is invisible:
I've gotten this to work for me by adding a:
Right before presenting calendar selector!
I also notice that I can't seem to set the style to anything dark, I was going to add a
However, even hardcoding it to
.black
seems to make keep it white!The text was updated successfully, but these errors were encountered: