Css 如何更改外部本机模块的样式

Css 如何更改外部本机模块的样式,css,reactjs,react-native,node-modules,external,Css,Reactjs,React Native,Node Modules,External,我对React Native还不熟悉,我正在为选项卡栏使用存储库 我能改变一些风格吗?默认情况下,气泡背景为蓝色,我想将其更改为其他颜色 在节点/react native fluidbottomnavigation下的index.js中,背景色定义为#4C53DD 我能从使用TabBar的那一点开始更改它吗 这是我的导航栏: 这是我在App.js中的代码: <TabBar onPress={tabIndex => { console.lo

我对React Native还不熟悉,我正在为选项卡栏使用存储库

我能改变一些风格吗?默认情况下,气泡背景为蓝色,我想将其更改为其他颜色

节点/react native fluidbottomnavigation
下的
index.js
中,背景色定义为
#4C53DD

我能从使用TabBar的那一点开始更改它吗

这是我的导航栏:

这是我在
App.js
中的代码:

<TabBar
          onPress={tabIndex => {
            console.log(tabIndex);
            curTab = tabIndex;
          }}
          values={[
            {
              title: 'requests',
              image: require('./assets/requests.png'),
              tintColor: 'red',
            },
            {
              title: 'requests',
              image: require('./assets/requests.png'),
              tintColor: 'blue',
            },
            {
              title: 'events',
              image: require('./assets/events.png'),
              default: true,
              tintColor: 'green',
            },
            {
              title: 'members',
              image: require('./assets/members.png'),
              tintColor: 'orange',
            },
            {
              title: 'account',
              image: require('./assets/account.png'),
              tintColor: 'yellow',
            },
          ]}
        />
{
console.log(tabIndex);
curTab=tabIndex;
}}
价值观={[
{
标题:“请求”,
图像:require('./assets/requests.png'),
tintColor:'红色',
},
{
标题:“请求”,
图像:require('./assets/requests.png'),
tintColor:'蓝色',
},
{
标题:"活动",,
image:require('./assets/events.png'),
默认值:true,
tintColor:'绿色',
},
{
标题:“成员”,
图:require('./assets/members.png'),
tintColor:'橙色',
},
{
标题:“账户”,
图:require('./assets/account.png'),
tintColor:'黄色',
},
]}
/>
此染色颜色不会改变背景颜色,如图中所示。我希望那个蓝色的圆圈是另一种颜色。

首先得到一个fork表单,然后得到一个克隆,做必要的更改并推送它

好了,现在你可以把它安装到你的应用程序了

npm install --save <git-url-of-your-fork>
npm安装--保存

有一个属性
tintColor
,可用于
TabBar
和以下各项:

从“react native fluidbottomnavigation”导入选项卡,{iconTypes};
{
console.warn(tabIndex);
}}
isRtl={true}
iconSize={25}
价值观={[
{title:“Home”,icon:“alarm”,tintColor:curTab==0?“red”:“blue”,默认值:true,isIcon:true,iconType:iconTypes.MaterialIcons},
{title:“Home1”,tintColor:curTab==1?“red:“blue”,},
{title:“Home2”,tintColor:curTab==2?“red:“blue”,},
{标题:“Home3”,tintColor:curTab==3?“红色”:“蓝色”,},
{title:“Home4”,tintColor:curTab==4?“red:“blue”,},
]}
/>

如果您在repo上仔细阅读我的答案和自述,您会发现
tintColor
不仅适用于选项卡项,而且也适用于
选项卡栏
组件本身。因此,如果您在自述页面设置
,就会有一个关于如何使用它的示例。在这里,您将看到
选项卡栏
的哪些属性及其支持的项目,其中包括
选项卡栏
tintColor
,以及可用于更改颜色的项目。无需分叉和更改任何Github回购协议。当组件更新时,您将执行什么操作?您每次都要重新设定回购的基础?tintColor更改字体颜色而不是背景颜色tintColor更改字体颜色而不是背景颜色color@Soteri检查第230行的代码,您将看到
style.bubble
style.minibuble
都有
背景颜色:“4C53DD”
正在扩展
背景色:this.props.tintColor
。你错了。你试过改变颜色吗?你能指出在源代码中,
tintColor
只影响字体颜色吗?请看我的question@Soteri我说的是更改
TabBar
组件的
tintColor
,而不是项目。请看一下我的最新答案和截图。