1import { Platform, StyleSheet } from 'react-native';
2
3const styles = StyleSheet.create({
4 container: {
5 flex: 1,
6 ...Platform.select({
7 ios: {
8 backgroundColor: 'red'
9 },
10 android: {
11 backgroundColor: 'green'
12 },
13 default: {
14 // other platforms, web for example
15 backgroundColor: 'blue'
16 }
17 })
18 }
19});
20
1import { Platform, StyleSheet } from 'react-native';
2
3const styles = StyleSheet.create({
4 height: Platform.OS === 'ios' ? 200 : 100
5});
1 const design = Platform.select({
2 android: {
3 header: true
4 },
5 ios: {
6 header: false
7 },
8 });