javascript - 你可以添加一个 BarTintColor 到 React Native Router

标签 javascript react-native router

是否可以将 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/

相关文章:

android - react native : wake a locked phone and play a sound

Angular 2 : Generate the route link using functions/Dynamically generate the routerLink

networking - 端口转发和 Python 套接字

javascript - Webpack、React、postCSS 和其他可能正确注入(inject)的 JS 代码存在产品构建问题

javascript - 将链接设置为等于上次单击的链接

javascript - 使用 useRef 和窗口调整大小事件(React Hook)观察 div 元素大小/尺寸

javascript - 如何从 Javascript 中的 AtomPub XML HTTP 响应中提取值(适用于 Google Apps 管理设置 API)

react-native - React native 中的 RTL 图表

android - 在 React Native 中按下按钮时一个接一个地附加 TextInput 组件

node.js - react 路由器将变量/状态传递给新路由?