Questions tagged [ios-darkmode]

In macOS and iOS (13.0 and later), users can choose to adopt a system-wide light or dark appearance. The dark appearance, known as Dark Mode, implements an interface style that many apps already adopt. Users choose the aesthetic they prefer, and can also choose to toggle their interface based on ambient lighting conditions or a specific schedule.

All iOS/Mac apps should support both light and dark interface styles, but might perform better with a specific appearance in some places.

271 questions
4
votes
1 answer

iOS dark mode. User Interface Style changes back and forth on entering on the background

I support dark mode. In some of my view controllers I use traitCollectionDidChange(_) for handling user interface style changes. override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { …
Valentin Shamardin
  • 3,569
  • 4
  • 34
  • 51
4
votes
1 answer

Unable to change the dark mode on the SwiftUI

I tried toggle the dark mode, I know Swift 4 or 5 I use the code: overrideUserInterfaceStyle = .dark But in SwiftUI, seem nothing way I can do that...how can I toggle the dark mode rest of app? I tried do many method and search everywhere but…
user12616082
4
votes
0 answers

iOS darkmode: image resized in signature switch background content with white

I am creating an email signature for a Gmail account. That is the code: https://jsfiddle.net/Geo87/pk3o2vhr/14/ The procedure to implement the email signature in Gmail is the following: Open the HTML file in a browser Copy the content of the HTML…
gBaylaender
  • 111
  • 6
4
votes
1 answer

UIBarButtonItem not change image automatically when switching dark mode/light mode

I am trying to integrate dark mode support to my app. But when setting image icon for UIBarButtonItem, it seem only works when the first time UIBarButtonItem is shown, it is not changed when I switch between dark mode/light mode. When using that…
erictruong
  • 303
  • 3
  • 14
4
votes
0 answers

Disable dark mode on widget?

I disabled the dark mode on the whole app through the info.plist but I'm not able to disable it on the Widget target Do you know any solution? Thank you
Gemix
  • 51
  • 4
4
votes
1 answer

iOS Text Field does not work in Dark Mode

I have a very simple page in my storyboard to create/edit a note. It's a basic ViewController, and the only content of the view is a UITextField for the title of the note, and a UITextView for the body of it, positioned right below. Both the body…
OstrichGlue
  • 325
  • 1
  • 4
  • 13
4
votes
1 answer

ios13 switching between light/dark mode not reflected on displayed keyboard with inputAccessoryView initially

When switching between light and dark mode with iOS 13, I am experiencing an unusual behavior with the keyboard showing. The view has an inputAccessoryView for a user to type in messages. When then light/dark mode is switched with the keyboard…
alionthego
  • 8,508
  • 9
  • 52
  • 125
4
votes
3 answers

How to handle custom colors for Dark Mode in Swift

Here is how I'm currently handling UI Element Colors for Dark Mode with a fallback for older operating systems. extension UIColor { class var mySystemBackground: UIColor { if #available(iOS 13, *) { return .systemBackground …
fs_tigre
  • 10,650
  • 13
  • 73
  • 146
4
votes
4 answers

iOS UILabel textColor not updating in dark mode

I have a collection view which shows time slots in the app. In the dark mode, it seems the UILabel is not showing the black text color on white background. In the storyboard, I have set the color as Black (also tried the Default color) for the…
Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
4
votes
4 answers

How to use dynamic colors in attributed strings via interface builder?

According to Implementing Dark Mode on iOS we need to set the foregroundColor attribute to the new label color. How is this done with interface builder? I tried using the "Text Color" option and setting the color to Developer->labelColor, but that…
Josh
  • 504
  • 3
  • 14
4
votes
1 answer

Images and Darkmode not switching

In a couple of my apps, I have an image covering the view in the background. In my asset catalog, my image has an Any, light and dark variation. In iOS 13, when I launch the app, the correct light or dark mode image is displayed according to the…
Stewart Lynch
  • 875
  • 9
  • 26
3
votes
1 answer

Swift: If traitCollection.userInterfaceStyle == .unspecified, how do I determine if it's in light or dark mode?

In the settings of my app, the user can choose between 3 system themes: light, dark, or default (which matches the phone's theme). I do this by finding the keyWindow and setting overrideUserInterfaceStyle = .dark for dark mode,…
3
votes
1 answer

Color change from light-mode to dark-mode not working in SwiftUI on real device

Using Swift5.3.2, iOS14.4.1, Xcode12.4, I try to make a custom-Color change when switching from light to dark mode in SwiftUI. Here is my code: import SwiftUI struct MyTestView : View { var body: some View{ VStack { …
iKK
  • 6,394
  • 10
  • 58
  • 131
3
votes
1 answer

Swift change text color to dark/lightmode

I am trying to change the text color in a UITextView from light grey to white/black. So the new text color should be white when the dark mode is on and the text color should be black when the light mode is on.
Fabian Müller
  • 318
  • 2
  • 11
3
votes
1 answer

SwiftUI ButtonStyle animation causes UI not to update in App Switcher snapshot when system appearance changes

In my app I have a button that I want to animate to scale down when it's touched. To do this, I created a custom ButtonStyle with an explicit animation. This works as intended but it introduced a problem when switching between dark/light mode system…
Jordan H
  • 52,571
  • 37
  • 201
  • 351