26

新的 iOS 13 更新引入了一个可选的系统范围。例如,这会导致 StatusBar 有浅色文本,在白色背景上可能会变得不可读。它还破坏了 iOS 日期时间选择器(请参阅DatePickerIOSreact-native-modal-datetime-picker

4

5 回答 5

76

解决方案是

  1. 将此添加到您的 Info.plist 文件中:
    <key>UIUserInterfaceStyle</key>
    <string>Light</string>

或者

  1. 将此添加到您的AppDelegate.m
    if (@available(iOS 13.0, *)) {
        rootView.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    }
于 2019-10-15T13:29:25.783 回答
3

在您的 app.json 文件中添加:

{
  "expo": {
     ...
     "ios": {
      "infoPlist": {
        "UIUserInterfaceStyle": "Light"
      }
    },
}
于 2020-07-20T14:28:40.930 回答
0

这个解决方案似乎效果最好。将此添加到您的AppDelagate.m

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];

  //add this here vv

  if (@available(iOS 13, *)) {
     self.window.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
  }

  //add this here ^^




 return YES;
于 2020-07-23T22:49:54.663 回答
0

这对我有用

  1. 将此添加到 Info.plist
<key>UIUserInterfaceStyle</key>
<string>Light</string>
  1. 这给你的 AppDelegate.m
  if (@available(iOS 13.0, *)) {
      rootView.backgroundColor = [UIColor systemBackgroundColor];
    self.window.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
  } else {
      rootView.backgroundColor = [UIColor whiteColor];
  }
于 2022-03-02T01:03:46.407 回答
0

将此添加到您的 Info.plist

<key>UIUserInterfaceStyle</key>
    <string>Light</string>

这给你的 AppDelegate.m

  rootView.backgroundColor = [UIColor whiteColor];
于 2021-12-02T07:57:00.953 回答