Answers for "react native styles for both platforms"

1

react native styles for both platforms

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'
      }
    })
  }
});
Posted by: Guest on September-06-2020
1

react native get OS

const design = Platform.select({
    android: {
      header: true
    },
    ios: {
	  header: false
    },
  });
Posted by: Guest on May-10-2020

Code answers related to "react native styles for both platforms"

Code answers related to "Javascript"

Browse Popular Code Answers by Language