18.7 C
Canberra
Thursday, April 9, 2026

ios darkmode – Popovers in iOS 26 show mistaken system colours and don’t change when person switches gentle/darkish mode


Because the title says, popovers in iOS 26 show mistaken system colours, and don’t change their colours when person switches gentle/darkish mode. That is in sharp distinction to all earlier methods, comparable to iOS 18, which behave appropriately. I am very stunned that apparently nobody has pointed this out.

As an instance the issue, this is an very simple app:

class ViewController: UIViewController {
    @IBAction func doButton(_ sender: UIButton) {
        let popover = ViewController2()
        popover.modalPresentationStyle = .popover
        if let presenter = popover.popoverPresentationController {
            presenter.sourceItem = sender
            presenter.delegate = self
        }
        current(popover, animated: true)
    }
}

extension ViewController: UIPopoverPresentationControllerDelegate {
    func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
        .none
    }
}

class ViewController2: UIViewController {
    override func viewDidLoad() {
        tremendous.viewDidLoad()
        view.backgroundColor = .systemBackground
        let label = UILabel()
        label.textual content = "Label"
        label.backgroundColor = .systemBackground
        view.addSubview(label)
        label.translatesAutoresizingMaskIntoConstraints = false
        label.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
        label.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
    }
}

Run the app and faucet the button to show the popover. The label within the popover appears like this:

label with wrong background

Nicely, that is simply mistaken. The label’s background shade is .systemBackground, and the colour of the popover view behind the label is .systemBackground; they need to each the be similar, i.e. basically white, after we are in gentle mode. As an alternative, the label background seems basically black.

(Please observe that .systemBackground shouldn’t be the one shade that shows this problem; you may see it with any dynamic shade that has .system in its title.)

Furthermore, now with the popover displaying, change your machine / simulator from gentle mode to darkish mode. I anticipate the entire background of the popover to change into darkish. It does not change in any respect! However should you dismiss the popover and present it once more, it is darkish. So it is aware of the present gentle/darkish mode on the time it seems, however it’s unresponsive to modifications in gentle/darkish mode.

Certainly, if we name registerForTraitChanges([UITraitUserInterfaceStyle.self]) within the popover’s viewDidLoad, we’ll discover that our motion methodology isn’t known as. The popover is solely not receiving gentle/darkish mode trait change info!

How are individuals coping with this problem?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles