使用nativebase尝试使用标题右侧的菜单按钮将搜索栏居中。代码如下:
<Header>
<Body>
<Button style={styles.searchButton} onPress={() => this.onSearchPress()} >
<Text>Search Service</Text>
</Button>
</Body>
<Right>
<Icon name='menu' style={styles.drawerIcon} onPress={()=> navigation.openDrawer()} />
</Right>
</Header>
如何以全宽定位中心?
答案 0 :(得分:0)
<Header>
<Left/>
<Body>
<Button style={styles.searchButton} onPress={() => this.onSearchPress()} >
<Text>Search Service</Text>
</Button>
</Body>
<Right>
<Icon name='menu' style={styles.drawerIcon} onPress={()=> navigation.openDrawer()} />
</Right>
</Header>