Avoid status bar overlap on all screens

前端 未结 2 1074
误落风尘
误落风尘 2021-01-01 23:37

I want all screens on my app to appear below the status bar on both iOS and Android, so I\'d either have to add a StatusBar component or a paddingTop

2条回答
  •  执念已碎
    2021-01-02 00:14

    You can create a component to hold all your different pages, so that you don't need to duplicate the StatusBar and padding code in every single screen component.

    I created a example in here: https://snack.expo.io/SyaCeMOwW

    And nothing need to change in term of your navigation structure or redux flow.

提交回复
热议问题