how to handle different screen sizes in react native?

后端 未结 3 2184
小鲜肉
小鲜肉 2021-02-14 02:35

I am developing an application on react-native. I have made a UI which works fine on iPhone 6 but not working fine on iPhone 5 or lower versions. How should I fix this ?

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-14 03:16

    Have you designed the app using fixed widths and heights? You should definitely use the capabilities of flexbox and try to avoid settings fixed sizes as much as possible. The flex property can be used to define how much space a should use releative to others, and the other properties on that page can be used to lay out elements in a flexible way that should give the desired results on a range of different screen sizes.

    Sometimes, you may also need a .

    When you do need fixed sizes, you could use Dimensions.get('window').

提交回复
热议问题