UIKit 的 textColor 的 iOS13 白色问题

标签 ios swift uitextfield uidatepicker ios13

在 iOS13 之前,应用程序布局正常工作。在 iOS13.1 中苹果更新了最新的深色主题和浅色主题之后,它们就是这样,现有应用程序面临许多问题。像 UITextField placeHolder 与 whiteColor 以前是 blackColor,UIDatePicker textColor 与 whiteColor 以前是 blackColor。

任何人都可以帮助我解决以下 DatePicker 文本颜色问题。这是不可见的,因为 whiteColor、TextColor 应该是 blackColor。

enter image description here

感谢任何帮助。 谢谢你。

最佳答案

搭载 iOS 13 的 Swift 5

Common solution which is work for my whole application without perform any file specific changes.

Work for Xcode 11 or higher version, Build upload fail on prior version of Xcode 11.

在您的 info.plist 文件中将 UIUserInterfaceStyle 设置为 1

enter image description here

AppDelegate.swift

    if #available(iOS 13.0, *) {
        window?.overrideUserInterfaceStyle = .light
    } else {
        // Fallback on earlier versions
    }

We have to specify user interface style light for any existing application.

关于UIKit 的 textColor 的 iOS13 白色问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57985583/

相关文章:

IOS MPMoviePlayerViewController 不断加载

iOS TableView 长按手势去 didselectrowatIndexpath

ios - 转换为 swift 3 语法后,应用无法通过 Facebook 和 Firebase 进行身份验证

ios - 如何从 Swift 中的文本字段获取整数值?

ios - 在实现类中没有任何逻辑的情况下自动向上滚动文本字段

iOS UISwitch Action 被调用了两次

objective-c - 在 SceneKit 模块中重新映射相机的 Truck、Yaw 和 Dolly 控件

ios - 如何在 Swift 中创建一个 UIPickerView 选择,以便 View 扩展以允许添加选项?

swift - Swift 有夏令时检查吗?

iphone - UIView 根据边缘调整大小