我开始使用react-navigation.
更改选项卡时如何更改tabBar背景颜色?
这是一些伪代码,显示了我希望的内容:
_backgroundColor = function() {
switch (this.routeName) {
case 'tabHome': return { backgroundColor: '#002663' };
case 'tabRewards': return { backgroundColor: '#3F9C35' };
default: return { backgroundColor: 'white' }
}
}
// Tabs setup
export const TabStack = TabNavigator({
tabHome: { screen: HomeStack, },
tabRewards: { screen: RewardsStack, },
}, {
tabBarOptions: {
style: _backgroundColor(),
}
});
Run Code Online (Sandbox Code Playgroud)
在那一刻它总是默认为白色(这很好,因为我的代码是错误的:-)所以我如何传递一些东西,在routeName或iconLabel或其他任何东西上触发这个逻辑.
非常感激任何的帮助.
提前致谢.
干杯
有点n00b问题。
如果我要使用 Apache Ignite 进行消息传递和事件,是否还需要使用 Kafka?
本质上来说,Kafka 会比 Ignite 提供哪些(如果有的话)附加功能?
提前致谢