Answers for "Platform react native"

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
1

react native get OS

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

react native

npx react-native init AwesomeProject
Posted by: Guest on April-28-2020
6

react native

React Native is an open-source mobile application framework created by Facebook.

It is used to develop applications for Android, iOS, Web and UWP by enabling
developers to use React along with native platform capabilities.
Posted by: Guest on June-16-2020
-1

react native

fijboibjfbiobjtohbrjhojtrhpotjhofthjtrho
Posted by: Guest on December-15-2020

Code answers related to "Platform react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language