禁用iOS13的暗黑模式

参考网址:
https://stackoverflow.com/questions/56537855/is-it-possible-to-opt-out-of-dark-mode-on-ios-13

参考苹果官方文档:
https://developer.apple.com/documentation/appkit/supporting_dark_mode_in_your_interface/choosing_a_specific_interface_style_for_your_ios_app?language=objc

According to Apple's "Implementing Dark Mode on iOS" Session (https://developer.apple.com/videos/play/wwdc2019/214/ starting at 31:13) it is possible to set overrideUserInterfaceStyle to UIUserInterfaceStyleLight or UIUserInterfaceStyleDark on any view controller or view, which will the be used in the traitCollection for any subview or view controller.

As already mentioned by SeanR, you can set UIUserInterfaceStyle to Light or Dark in you app's plist file to change this for your whole app.

即在info.plist中添加UIUserInterfaceStyle设置为light或者dark即可强制修改模式

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,499评论 0 10
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 10,129评论 0 23
  • 昨天晚上孩子好好的睡着 晚上莫名的就发烧了 一夜辗转难眠 想着第二天喂药又是一件艰难的事情 早上六点多...
    新颠峰家庭教育智慧池敏阅读 308评论 1 0
  • 大学生记者团 牛婧锜 情绪是存在在每一个人身上的一种因素,它可以鼓励人前进,也可以使人消极待事。也可以说情绪决定了...
    小花妹妹_d818阅读 208评论 0 0
  • 相信女人的第六感吗?我的第六感一直都灵,左眼跳灾,右眼跳财,有时候人真的该迷信迷信…… 可是有时我真的不愿相信...
    果果liang阅读 285评论 3 0