Platform Specific Stylesheet for React Native
npm install react-native-platform-stylesheetReact Native Platform Stylesheet
===
Seperated out the F8StyleSheet to a module.
1. npm install react-native-platform-stylesheet
2. Use it in your project:
``js`
import { create } from 'react-native-platform-stylesheet';
const Profile = () => (
{/ ... /}
);
const styles = create({
container: {
flex: 1,
ios: {
backgroundColor: 'salmon'
},
android: {
backgroundColor: 'tomato'
}
}
});
`
or
js`
import { create } from 'react-native-platform-stylesheet';
const Profile = () => (
{/ ... /}
);
const styles = create({
container: {
flex: 1
},
ios: {
container: {
backgroundColor: 'salmon'
}
},
android: {
container: {
backgroundColor: 'tomato'
}
}
});
ios
Note: in the second example, make sure that and android` styles are defined in the end of the object.