You need to calculate the sizes dynamically, relying on the screen size.
import { Dimensions, StyleSheet } from 'react-native' [...] const { width, height } = Dimensions.get('window') [...] const styles = StyleSheet.create({ container: { flex: 1. flexDirection: 'column', }, myView: { width: width * 0.8,
If you use TabbarIOS , remember that Dimensions.get('window') gives you the whole height of the screen, this means that you will need to take into account that the tab has a fixed height of 56, For example, when using TabbarIOS :
const WIDTH = Dimensions.get('window').width, HEIGHT = Dimensions.get('window').height - 56
Then use WIDTH and HEIGHT as above.
source share