【发布时间】:2017-05-04 13:57:26
【问题描述】:
代码如下:
// Bottom.js
<StyleProvider style={getTheme(commonColor)}>
<Footer>
<FooterTab>
<Button active>
<Icon active name="food" size={24} />
<Text active>Lunch Box</Text>
</Button>
<Button>
<Icon name="coins" size={24} />
<Text>Point</Text>
</Button>
<Button>
<Icon name="face" size={24} />
<Text>Profile</Text>
</Button>
</FooterTab>
</Footer>
</StyleProvider>
// commonColor.js
// Footer
footerHeight: 55,
footerDefaultBg: '#ffffff',
// FooterTab
tabBarTextColor: '#FFF',
tabBarTextSize: platform === 'ios' ? 14 : 16,
activeTab: platform === 'ios' ? '#007aff' : '#fff',
sTabBarActiveTextColor: '#007aff',
tabBarActiveTextColor: '#fff',
tabActiveBgColor: platform === 'ios' ? '#1569f4' : '#1569f4',
我试过直接编辑FooterTab.js,但完全没有改变。
渲染时唯一可能发生的变化是tabActiveBgColor: platform === 'ios' ? '#1569f4' : '#1569f4'。而且我什至不知道为什么只有这段代码有效,我什至没有在FooterTab 上设置任何active。
我期望的是当我将按钮设置为活动时,文本变为白色。
有什么办法吗?
【问题讨论】:
-
你使用的是什么版本的 React Native 和 NativeBase?
标签: android react-native react-native-android native-base