Home > Blockchain >  I want access whcih operating system is code runnning in react-native?
I want access whcih operating system is code runnning in react-native?

Time:03-27

I want different font in Android and different in IOS on the Same Javascript File . Is it possible to access the Operating System through Coding ? I am new to coding and in react-native, help is appreciated . Thank You.

CodePudding user response:

You can use platform in react-native , below i add some code for your reference:

import { Platform, StyleSheet } from 'react-native';

const styles = StyleSheet.create({
height: Platform.OS === 'ios' ? 200 : 100
});
  • Related