Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native 深色模式支持 #10916

Open
zhiqingchen opened this issue Dec 16, 2021 · 5 comments
Open

React Native 深色模式支持 #10916

zhiqingchen opened this issue Dec 16, 2021 · 5 comments
Assignees
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x

Comments

@zhiqingchen
Copy link
Member

相关平台

React Native

使用框架: React

复现步骤

打开系统的深色模式
iOS statusbar无法显示,input的placeholder无法显示

期望结果

支持深色模式

实际结果

不支持深色模式

环境信息

👽 Taro v3.3.15


  Taro CLI 3.3.15 environment info:
    System:
      OS: macOS 12.0.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 15.12.0 - /usr/local/bin/node
      Yarn: 1.22.10 - ~/.nvm/versions/node/v15.12.0/bin/yarn
      npm: 7.6.3 - ~/.nvm/versions/node/v15.12.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.3.15 => 3.3.15
      @tarojs/components: 3.3.15 => 3.3.15
      @tarojs/mini-runner: 3.3.15 => 3.3.15
      @tarojs/react: 3.3.15 => 3.3.15
      @tarojs/runtime: 3.3.15 => 3.3.15
      @tarojs/taro: 3.3.15 => 3.3.15
      @tarojs/webpack-runner: 3.3.15 => 3.3.15
      babel-preset-taro: 3.3.15 => 3.3.15
      eslint-config-taro: 3.3.15 => 3.3.15
      react: ^17.0.2 => 17.0.2
      react-native: ^0.66.0 => 0.66.3
    npmGlobalPackages:
      typescript: 4.2.3
@taro-bot2 taro-bot2 bot added F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x labels Dec 16, 2021
@zhiqingchen
Copy link
Member Author

image

@zhiqingchen
Copy link
Member Author

@zhiqingchen
Copy link
Member Author

ios 禁用深色模式

修改 ios/taroDemo/Info.plist

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

@zhiqingchen
Copy link
Member Author

android 禁用深色模式

修改 android/app/src/main/res/values/styles.xml

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

@zhiqingchen
Copy link
Member Author

statusbar颜色可以自行控制,如下

      <StatusBar
        translucent
        backgroundColor="rgba(0, 0, 0, 0)"
        barStyle="dark-content"
      />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-rn Target - 编译到 React Native V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants