RN中隱藏狀態欄的方式很簡單,在頁面的根布局的頂部添加一個StatusBar即可,設置相關屬性如下:
export default class MainPage extends Component { render() { return( <View style={{flex: 1}}> <StatusBar backgroundColor="#ff0000" translucent={true} hidden={true} animated={true}/> <Text>HelloWord</> </View> ) } }
原文鏈接:https://blog.csdn.net/qq_28484355/article/details/81320019