ios-darkmode

Why doesn't my iOS app disable dark mode?

别等时光非礼了梦想. 提交于 2020-04-10 08:30:50
问题 So ... I've tried to set my app to disable iOS 13 dark mode by forcing light mode according apple documentation, in the emulator all attempts work fine, but when I try on the real device, nothing happens, it's like I've never changed my code First Attempt Override the Interface Style for a Window, View, or View Controller I tried to put this code sample in my viewDidLoad() Nothing Changed if #available(iOS 13.0, *) { overrideUserInterfaceStyle = .light } else { // Fallback on earlier versions

SKStoreKitReviewController and Darkmode

旧巷老猫 提交于 2020-02-21 09:56:26
问题 Is there any way to alter the colors/tint of an SKStoreKitReviewController? When I am modifying my apps to support DarkMode, when in dark mode, the presented viewController does not look good. 回答1: This issue was resolved in iOS 13.2. The blur effect is dark, just like other system alerts when Dark Mode is enabled. 来源: https://stackoverflow.com/questions/57763132/skstorekitreviewcontroller-and-darkmode

Change UIDatePicker selected Date text Color for Dark mode (iOS 13)

你离开我真会死。 提交于 2020-01-23 04:59:09
问题 Having trouble to find out a solution for changing the color of text for the selected Date in iOS 13 dark mode. I know how to change the color of the text of a UIPicker view using code self.timePicker.setValue(UIColor.black, forKeyPath: "textColor") OR using User Defined Runtime Attributes. But nothing is working for changing the selected date color for iOS 13 Dark mode. With background white color and black text color, my date picker-view looks like this: So with changing the text color

hasDifferentColorAppearance is true when app is backgrounded

夙愿已清 提交于 2019-12-31 00:45:51
问题 Apple recommends that we use traitCollectionDidChange and compare trait collections using hasDifferentColorAppearance to catch when dark mode is toggled, and act on it if we need to. Like this: override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) if #available(iOS 13.0, *) { let hasUserInterfaceStyleChanged = previousTraitCollection?.hasDifferentColorAppearance(comparedTo: traitCollection) ?? false if

How can I check ios device's current userInterfaceStyle programmatically?

那年仲夏 提交于 2019-12-30 05:20:05
问题 I am able to get userInterfaceStyle using TraitCollection of any view or ViewController ie. Dark or Light. But when I forced app to use Dark or light Mode, then I want to know what is the current userInterfaceStyle of iOS device irrespective of app? I tried Traitcollection of UIScreen but still its provide userInterfaceStyle of app not device. 回答1: Try UIScreen.main , swift 5 example: // OS-wide theme available on iOS 13. @available(iOS 13.0, *) var osTheme: UIUserInterfaceStyle { return

How to prevent iOS 13 Dark Mode from breaking emails

自作多情 提交于 2019-12-21 04:25:43
问题 We have an e-commerce app that sends out order details when a purchase is made, and we just redesigned that email template. We've received reports over the past few days of some customers having half the text in the email missing. After finally getting a screenshot, we've learned that the issue is happening on iPhones using dark mode. So far they've all been customers using gmail with either the Mail app or with Safari (both have the same problem). I'm not sure if the gmail factor is relevant

UIColor return wrong values for dark mode colors

99封情书 提交于 2019-12-18 01:10:35
问题 I have a custom UITextField subclass which changes its border color when typing something in it. I'm listening for changes by calling self.addTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged) and then, in textFieldDidChange(_:) I'm doing: self.layer.borderColor = UIColor(named: "testColor")?.cgColor Where testColor is a color defined in Assets.xcassets with variants for light and dark mode. The issue is that UIColor(named: "testColor")?.cgColor seems to always

UIView's shadowpath color doesn't change

走远了吗. 提交于 2019-12-17 21:24:11
问题 I have a UIView and I set a shadowPath for it like this: func addShadow() { let cornerRadius: CGFloat = self.containerView.frame.height/2 self.containerView.layer.shadowPath = UIBezierPath(roundedRect: self.containerView.frame, cornerRadius: cornerRadius).cgPath self.containerView.layer.shadowRadius = cornerRadius self.containerView.layer.shadowOffset = .zero self.containerView.layer.shadowOpacity = 0.2 self.containerView.layer.cornerRadius = cornerRadius self.containerView.layer.shadowColor

Is it possible to opt-out of dark mode on iOS 13?

元气小坏坏 提交于 2019-12-17 07:54:31
问题 A large part of my app consists of web views to provide functionality not yet available through native implementations. The web team has no plans to implement a dark theme for the website. As such, my app will look a bit half/half with Dark Mode support on iOS 13. Is it possible to opt out of Dark Mode support such that our app always shows light mode to match the website theme? 回答1: First, here is Apple's entry related to opting out of dark mode. The content at this link is written for Xcode

Is it possible to opt-out of dark mode on iOS 13?

懵懂的女人 提交于 2019-12-17 07:54:11
问题 A large part of my app consists of web views to provide functionality not yet available through native implementations. The web team has no plans to implement a dark theme for the website. As such, my app will look a bit half/half with Dark Mode support on iOS 13. Is it possible to opt out of Dark Mode support such that our app always shows light mode to match the website theme? 回答1: First, here is Apple's entry related to opting out of dark mode. The content at this link is written for Xcode