是否可以将 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 .
然后,您可以提供具有模糊背景效果的自定义导航栏。
关于javascript - 你可以添加一个 BarTintColor 到 React Native Router,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36351402/