这是我在 router.js 文件中的代码(取自react-native-router-flux文档部分):
import React, { Component } from 'react';
import { Router, Scene } from 'react-native-router-flux';
import PageOne from './PageOne';
import PageTwo from './PageTwo';
export default class App extends Component {
render() {
return (
<Router>
<Scene key="root">
<Scene key="pageOne" component={PageOne} title="PageOne" initial={true} />
<Scene key="pageTwo" component={PageTwo} title="PageTwo" />
</Scene>
</Router>
)
}
}
如何更改“标题”的背景颜色(上图中出现“返回”箭头的位置)?
我试过这种方式(添加sceneStyle={{ backgroundColor: 'red'}}
):
<Scene key="pageTwo" component={PageTwo} title="PageTwo" sceneStyle={{ backgroundColor: 'red'}} />
但它似乎不起作用。
供参考:
"react-native": "0.34.1",
"react-native-router-flux": "^3.35.0"