javascript - react 导航和状态栏颜色在 View 更改时闪烁

在 react-navigation v5 alpha 中,当我在 View 之间导航时,我的 statusBar 颜色会闪烁。

它的最终状态通常不是我们想要的,而在开发和处理 View 时,它会在热重载后获得正确的颜色,但在导航时,通常是深色主题获胜。

即使我在下一个 View 中使用:

<StatusBar barStyle="light-content" translucent={true} backgroundColor="transparent" />

这发生在 expo SDK36 应用程序中。

我该如何解决这个问题?

最佳答案

animated={true} 添加到 StatusBar,这将平滑地改变栏颜色。

<StatusBar animated={true} barStyle="light-content" translucent={true} backgroundColor="transparent" />

关于javascript - react 导航和状态栏颜色在 View 更改时闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61096827/

相关文章:

python - 使用 MCP3002 模数转换器控制 LED 亮度

python - 带有 GEKKO 的轨迹规划器无法处理给定的目标速度

react-native - react native 文本输入键盘如何显示点而不是逗号?

symfony - 如何通过 Swagger Decorator 在 API 平台中记录自定义 PO

google-cloud-platform - GCP Bigquery 通过 Terraform

angular - 接口(interface)对象属性未定义,但有 Angular 值

node.js - Angular 9 Node.js AWS - 从 'aws-sdk' 添加导入

c# - IOptions 验证不会触发,直到我在 Asp.Net Core 3 中显式调用具有属性

python - 没有 Conda 的 Conda environment.yml

typescript - 输入单个记录条目