Answers for "react native Platform"

0

Platform react native

import {Platform} from 'react-native';
    st styles = StyleSheet.create({
      container: {
        flex: 1,
        ...Platform.select({
          ios: {
            backgroundColor: 'red',
          },
          android: {
            backgroundColor: 'blue',
          },
        }),
      },
    });


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

const styles = StyleSheet.create({
  height: Platform.OS === 'ios' ? 200 : 100,
});
Posted by: Guest on March-18-2021
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
0

react native Platform

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

const styles = StyleSheet.create({
  height: Platform.OS === 'ios' ? 200 : 100
});
Posted by: Guest on July-25-2021
-1

react native

simple emulator android cli for running react native, flutter and more
here -> https://github.com/restuwahyu13/bangjago-emulator
Posted by: Guest on November-02-2020

Code answers related to "react native Platform"

Code answers related to "Javascript"

Browse Popular Code Answers by Language