react-native - 反应本机应用程序中的底部标签背景颜色
问题描述
我在我的世博会应用程序 react-navigation 和底部选项卡中使用。
我已经指定了一些这样的选项:
<TabStack.Navigator
initialRouteName="Compte"
tabBarOptions={{
activeTintColor: EAppColors.PRIMARY_GREEN,
labelStyle: {
fontFamily: 'BeVietnam-Regular',
fontSize: normalize(12),
fontStyle: 'normal',
lineHeight: 20,
textAlign: 'center',
marginBottom: 5,
},
tabStyle: {
alignItems: 'center',
justifyContent: 'center',
height: 40,
marginTop: '3.5%',
},
style: { paddingHorizontal: '5%' },
}}>
我需要在标签栏的左侧和右侧放置一些顶部半径,但后面的视图保持其颜色....
如何更改后面视图的颜色?(图片左上角灰色)
解决方案
<TabStack.Navigator></TabStack.Navigator>
用View
一些包裹你backgroundColor
像这样的东西
<View style={{ flex:1, backgroundColor: 'red' }}> // Or whatever color you want
<TabStack.Navigator>
// All TabScreens etc.. here
</TabStack.Navigator>
</View>
推荐阅读
- php - 如何在填充有 DB::select 的 Laravel Excel 3.0 上创建
- excel - 如何从不包含特定字符的列表中复制值?
- ruby - Ruby - 如何在 2 人骰子游戏中使用 while 循环和条件语句?
- java - Webdriver 中的已定义步骤生成未定义步骤?
- mysql - 合并 MySQL 中的两列并忽略 NULL
- javascript - 如何使用 querySelector 找到正确的元素
- bash - 权限被拒绝在 mac 上编辑 .bash_profile rbenv init
- node.js - Braintree dropin ui 显示卡号中插入子弹标记的垃圾字符
- java - 使用默认邮件客户端从 Java 发送电子邮件
- php - PHP 应用程序中的其他会话