更改场景的标题元素的文本颜色

问题描述 投票:0回答:1

我正在使用React Native和react-native-router-flux创建一个小型Android移动应用程序。

我已经定制了除主屏幕的leftTitlerightTitle属性之外的所有内容。我可以说出他们的名字,但我不能给他们打造。它们保持这种蓝色,如下图所示。

enter image description here

这是该场景的代码:

<Scene
  rightTitle="Add"
  onRight = { () => Actions.employeeCreate() }
  key="employeeList"
  component={EmployeeList}
  title="Employees"
  leftTitle="Log Out"
  onLeft={ () => logUserOut() }
  initial
/>

有谁知道如何更改标题文字的颜色?

谢谢!

react-native react-native-router-flux
1个回答
2
投票
  1. react-native-router-flux中找到node modules文件夹
  2. 导航到react-native-router-flux > src > NavBar.js
  3. 像这样在StyleSheet中编辑颜色样式barRightButtonTextbarLeftButtonText

对于右键文字:

 barRightButtonText: {
    color: 'rgb(0, 122, 255)',    //Your rgb color code here
    textAlign: 'right',
    fontSize: 17,
  },

对于左键文字

 barLeftButtonText: {
    color: 'rgb(0, 122, 255)',  //Your rgb color code here
    textAlign: 'left',
    fontSize: 17,
  },
© www.soinside.com 2019 - 2024. All rights reserved.