我正在开发react-native应用,并希望在Scene
组件中预定义标头样式(来自react-native-router-flux
)
这是我的modalScene.js
export default class ModalScene extends React.Component {
constructor (props) {
super(props)
}
render () {
return (
<Scene
key={ this.props.key }
direction={ this.props.key || 'vertical'}
hideNavBar={ false }
duration={ 0 }
component={ this.props.component }
navigationBarStyle={{
backgroundColor: global.color.superWhite,
paddingTop: 18,
paddingBottom: 0,
height: 100
}}
backButtonTextStyle={{
paddingLeft: 10,
color: 'black',
fontSize: 20,
lineHeight: 22,
fontWeight: 'bold'
}}
backTitle={ this.props.backTitle }
backButtonImage={ require('../../assets/img/icons/backButton.png') }
{...this.props}
/>
)
}
}
当我在Router
<ModalScene
key='signup'
component={ SignupScreen }
backTitle='Вход'
/>
它无法正常工作。我做错了什么?