我正在使用ToolbarAndroid,需要将标题居中显示。但是我无法弄清楚这个操作该如何实现。使用样式属性也没有奏效。
以下是我的代码:
<ToolbarAndroid
title={toolbarTitle(this.props.activeTab)}
titleColor='white'
style={styles.toolbar}
actions={toolbarActions(this.props.activeTab)}
onActionSelected={this._onActionSelected.bind(this)}>
</ToolbarAndroid>
工具栏样式:
toolbar: { height: 50, backgroundColor: 'grey' }
我可以根据当前选项卡(使用可滚动选项卡视图)呈现标题属性和其他属性,但是在我的方法中更改标题位置并没有起作用。
styles.toolbar
的代码? - Isaac Madwed