react-native - 更改场景标题元素的文本颜色
问题描述
我正在使用 React Native 和 react-native-router-flux 创建一个小型 Android 移动应用程序。
除了主屏幕的leftTitle
and属性之外,我已经自定义了所有内容。rightTitle
我可以命名它们,但我无法设置它们的样式。它们保持这种蓝色,如下图所示。
这是该场景的代码:
<Scene
rightTitle="Add"
onRight = { () => Actions.employeeCreate() }
key="employeeList"
component={EmployeeList}
title="Employees"
leftTitle="Log Out"
onLeft={ () => logUserOut() }
initial
/>
有谁知道如何更改标题文本的颜色?
谢谢!
解决方案
- 在中查找
react-native-router-flux
文件夹node modules
- 导航到
react-native-router-flux > src > NavBar.js
- 像这样编辑颜色样式
barRightButtonText
和样式表barLeftButtonText
对于右键文本:
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,
},
推荐阅读
- unit-testing - 如何修复这些错误而不是在 qarsar 测试中用 jest 导入某些模块?
- reactjs - 类型“{}”上不存在属性“schProd”| { schProd:字符串;}'
- python-3.x - 我无法在 alpine 上使用 pip3 安装 python 包
- angular - 如何创建一个可以从具有不同参数的不同组件调用的通用角度 ng2-charts(条形图)组件
- java - 在 Java 中使用 selenium 登录 facebook
- reactjs - 将道具作为 {...props} 而不是 myProp={value} 给组件是否会重新渲染该组件?
- pom.xml - pom.xml 错误,无法在我的 pom.xml 中找到问题所在
- node.js - Typescript 在使用 Promises 时生成 __awaiter、__generator
- mysql - MYSQL - 从选择“自身”中检查可能吗?
- c# - System.Text.UTF8Encoding().GetBytes 添加换行符