告诉我们您正在使用哪些版本:
我正在尝试像下面的屏幕截图一样更改箭头颜色。 但是,我无法为每个场景设置颜色。 我只能在根场景上做。 我错过了什么还是它是一个错误?
当我将它设置为根场景时,它可以使用此代码。
<Router >
<Scene key="root" titleStyle={{ color: 'red' }} barButtonIconStyle={{ tintColor: 'green' }}>
<Scene key="connexion" component={Connexion}
hideNavBar={false} title="Connexion" initial={true}/>
<Scene key="signup" component={Signup} hideNavBar={false}
title="PageOne" navigationBarStyle={NavBarStyle.bar.darkNavigationBar}
/>
</Scene>
</Router>
我想分别设置每个场景样式(如此代码)。 甚至有可能吗
<Router >
<Scene key="root" titleStyle={{ color: 'red' }}>
<Scene key="connexion" component={Connexion}
hideNavBar={false} title="Connexion" initial={true}/>
<Scene key="signup" component={Signup} hideNavBar={false}
title="PageOne" navigationBarStyle={NavBarStyle.bar.darkNavigationBar}
barButtonIconStyle={{ tintColor: 'green' }}
/>
</Scene>
</Router>
在每个场景中,你可以给backButtonTextStyle={{ ... }}
我尝试将其添加到具有以下属性的场景中:
但它不起作用..
你会尝试以下@Shakarang
<Scene ... leftButtonIconStyle = {{ tintColor:'red'}} />
您始终可以深入了解:
node_modules/react-native-router-flux/src/back_chevron.png
并根据需要编辑“back_chevron.png”。
哦对不起,我误读了您最初的评论,只是意识到您正在尝试为每个场景设置它。
leftButtonIconStyle={{ tintColor: 'green' }} 确实是要走的路
这在我的项目中不起作用。
版本
“反应”:“16.0.0-alpha.12”,
“反应原生”:“^0.46.3”,
"react-native-router-flux": "^4.0.0-beta.12"
需要更新回图标颜色。
同样的问题,在 RNRF 4.0.0-beta.15 上,leftButtonIconStyle 和 barButtonIconStyle 都不起作用
<Scene
key="root"
headerTintColor="#000"
>
这在[email protected]上对我
headerTintColor
似乎是正确的,但是大小呢? 或者,如果我们想要一个不同的后退图标?
在此处查看导航栏的样式。
如果要更改图标,可以在场景中使用leftButtonImage
或renderBackButton
道具。
<Scene
key='HomePage'
component={HomePage}
renderBackButton={<Icon name='chevron-left' />}
/>
像这样?
renderBackButton
不是函数
更新:
renderBackButton={() => <Icon name='chevron-left' />}
这可以正确呈现箭头,但按下时它不会做任何事情..
我们真的必须自己重新实现后台功能吗?
@Frexuz这也是我现在正在努力解决的问题。 我想要的只是为导航按钮使用类似包图标的东西,而不是图像或文本。
看来我们必须自己为每个场景重新实现触摸功能(很可能是路由)(即,如果您选择使用 renderBackButton 或 renderRightButton,则 onRight/onLeft 不会做任何事情)。
headerTintColor="#000"
它也对我有用
<Scene key="root" headerTintColor="#000" >
这在[email protected]上对我
它也对我有用。 注册护士 0.59
最有用的评论
你会尝试以下@Shakarang
<Scene ... leftButtonIconStyle = {{ tintColor:'red'}} />