gpt4 book ai didi

react-native - 更改状态栏颜色

转载 作者:行者123 更新时间:2023-12-04 05:10:04 25 4
gpt4 key购买 nike

如何为状态栏选择颜色?我在这里找到了一个答案,但我需要它要么是全局的,要么在我拥有的每个 View 中设置它的颜色,根据我找到的答案,我不知道该怎么做。我正在使用 React-Native 并尝试在此处更改状态栏颜色:

<StatusBar
barStyle="light-content"
backgroundColor="#484A80"
/>

但是没有用。感谢您的帮助!

最佳答案

您可以使用setBackgroundColor方法:

StatusBar.setBackgroundColor(this.props.color, true)

关于react-native - 更改状态栏颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43494928/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com