how to use platform.select
import { Platform, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
...Platform.select({
ios: {
backgroundColor: 'red'
},
android: {
backgroundColor: 'green'
},
default: {
// other platforms, web for example
backgroundColor: 'blue'
}
})
}
});
const design = Platform.select({
android: {
header: true
},
ios: {
header: false
},
}); import {Platform} from 'react-native';
st styles = StyleSheet.create({
container: {
flex: 1,
...Platform.select({
ios: {
backgroundColor: 'red',
},
android: {
backgroundColor: 'blue',
},
}),
},
});
Also in JavaScript:
- python json.dumps pretty print
- horizontal cards react bootstrap
- validate gender in javascript
- function expression javascript
- vuex.esm.js
- create json model online
- react router dom push
- get file extension of path extendscript
- javascript recursion example
- set padding jquery
- how to check if an array contains a number in javascript
- jQuery exclude exteranl link for images
- javascript iterate over json
- express-jwt error algorithms should be set
- asp.net core 3.1 ajax partial view
- toggle class javascript and jquery
- javascript hash string
- lowercase javascript
- how to delete element in array in javascript
- javascript convert Object.entries back to object
- How to delete an item in an object in redux
- butonc click jquery
- open close children modal react
- what is react mounting