gpt4 book ai didi

javascript - 你能给 React Native Router 添加 BarTintColor 吗

转载 作者:行者123 更新时间:2023-11-29 21:31:22 24 4
gpt4 key购买 nike

是否可以将 BarTintColor 添加到 React Native Router和 NavigatorIOS 一样?

场景有一个 navigationBarStyle 属性,允许您使用 alpa 设置颜色:navigationBarStyle={{backgroundColor:"#rgba(52,52,52,0.9)"}} 但没有模糊效果。

最佳答案

深入研究github代码,不,没有在背景上设置模糊效果的选项。

但是有一个解决方案来设置你自己的导航栏:你可以提供一个组件或在场景的组件上设置一个功能:

<Scene key="login" component={Login} title="Login" navBar={myNavBarComponent}/>
// or ...

// In Login Component
renderNavigationBar(navBarProps, selectedScene) {

// return CustomNavBar Component
}

如果你想实现iOS的虚化背景效果,看看https://github.com/react-native-fellowship/react-native-blur#vibrancy-view .
然后,您可以提供具有模糊背景效果的自定义 NavBar。

关于javascript - 你能给 React Native Router 添加 BarTintColor 吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36351402/

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