Android 在React Native中更改状态栏颜色

Android 在React Native中更改状态栏颜色,android,ios,react-native,uistatusbar,react-typescript,Android,Ios,React Native,Uistatusbar,React Typescript,在React Native中,我试图将状态栏设置为“light content”,以便在较暗的背景下更可见。为此,我使用了,但是当我运行代码时,我得到了以下错误: 我进入info.plist页面,根据错误消息将UIViewControllerBasedStatusBarAppearance设置为false,但这仍然没有起到任何作用。在iOS上,您只能通过 在Android上,您可以使用backgroundColorprops RCTStatusBarManager module requir

在React Native中,我试图将状态栏设置为“light content”,以便在较暗的背景下更可见。为此,我使用了,但是当我运行代码时,我得到了以下错误:




我进入info.plist页面,根据错误消息将UIViewControllerBasedStatusBarAppearance设置为false,但这仍然没有起到任何作用。

在iOS上,您只能通过

在Android上,您可以使用
backgroundColor
props

RCTStatusBarManager module requires that the                 UIViewControllerBasedStatusBarAppearance key in the Info.plist is set to NO
-[RCTStatusBarManager setStyle:animated:]
    RCTStatusBarManager.mm:157
__invoking___
-[NSInvocation invoke]
-[NSInvocation invokeWithTarget:]
-[RCTModuleMethod invokeWithBridge:module:arguments:]
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
-[UIApplication _run]
UIApplicationMain
main
start
0x0