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
1 const design = Platform.select({
2 android: {
3 header: true
4 },
5 ios: {
6 header: false
7 },
8 });
1 import {Platform} from 'react-native';
2 st styles = StyleSheet.create({
3 container: {
4 flex: 1,
5 ...Platform.select({
6 ios: {
7 backgroundColor: 'red',
8 },
9 android: {
10 backgroundColor: 'blue',
11 },
12 }),
13 },
14 });
15