iOS13 White Color issue with textColor of UIKit

六眼飞鱼酱① 提交于 2019-11-28 09:02:15

问题


Before iOS13 application Layout working as excepted. After latest dark theme and light theme update by apple in iOS13.1, Their is so, many issue facing in existing application. Like UITextField placeHolder with whiteColor which are previously blackColor, UIDatePicker textColor with whiteColor which are previously blackColor.

Can anyone help me with below DatePicker text color issue. which are invisible because whiteColor, TextColor should be blackColor.

Any help appreciated. Thank you.


回答1:


Swift 5 with iOS 13

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.

Set UIUserInterfaceStyle to 1 in your info.plist file.

OR

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.




回答2:


This could help you.

override func viewDidLoad() {
    super.viewDidLoad()
    if #available(iOS 13.0, *) {
        // Always adopt a light interface style.
        overrideUserInterfaceStyle = .light
    }
}


来源:https://stackoverflow.com/questions/57985583/ios13-white-color-issue-with-textcolor-of-uikit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!