【发布时间】:2017-04-10 01:02:06
【问题描述】:
当到达应用程序的某个部分时,如何更改 StatusBar backgroundColor 属性?
例如:我有一个View(Section),默认backgroundColor是红色,当向下滚动到那个section时我想把StatusBar的backgroundColor改为蓝色。
这是我想要做的组件(注意:我使用的是 Native Base):
<Container>
<StatusBar backgroundColor='#2c3e50' barStyle='dark-content' />
<Content>
<Grid>
<Col>
<Row>
<Text>
App title name
</Text>
</Row>
</Col>
<Row>
<Col>
<Text>
Random description
</Text>
</Col>
</Row>
<Col>
<Row>
<Text>
</Text>
</Row>
</Col>
<Row>
<Col style={{padding: 20, backgroundColor: '#2980b9'}}>
<Text style={{color: 'white', textAlign: 'justify'}}>
Random text
</Text>
<Text style={{ color: 'white', paddingTop: 10, textAlign: 'justify'}}>
More random text
</Text>
</Col>
</Row>
<Row>
<Col style={{backgroundColor: '#1abc9c'}}>
<Text style={{color: 'white', fontSize: 40, textAlign: 'center'}}>
Chocolate
</Text>
</Col>
</Row>
<Row>
<Col>
<Text>
Random txt
</Text>
</Col>
</Row>
</Grid>
</Content>
</Container>
【问题讨论】:
-
发布你做了什么
标签: android react-native