1.在 info.plist 中添加View controller-based status bar appearance,值为NO。
2.在设置状态栏的地方添加代码:
UIApplication.shared.setStatusBarStyle(.lightContent, animated: false)