Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

platform check in react native for status bar color

import React, {
  Component,
} from 'react';
import {
  AppRegistry,
  StyleSheet,
  View,
  StatusBar,
  Platform,
  SafeAreaView
} from 'react-native';

const MyStatusBar = ({backgroundColor, ...props}) => (
  <View style={[styles.statusBar, { backgroundColor }]}>
    <SafeAreaView>
      <StatusBar translucent backgroundColor={backgroundColor} {...props} />
    </SafeAreaView>
  </View>
);

class DarkTheme extends Component {
  render() {
    return (
      <View style={styles.container}>
        <MyStatusBar backgroundColor="#5E8D48" barStyle="light-content" />
        <View style={styles.appBar} />
        <View style={styles.content} />
      </View>
    );
  }
}

const STATUSBAR_HEIGHT = StatusBar.currentHeight;
const APPBAR_HEIGHT = Platform.OS === 'ios' ? 44 : 56;

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  statusBar: {
    height: STATUSBAR_HEIGHT,
  },
  appBar: {
    backgroundColor:'#79B45D',
    height: APPBAR_HEIGHT,
  },
  content: {
    flex: 1,
    backgroundColor: '#33373B',
  },
});

AppRegistry.registerComponent('App', () => DarkTheme);
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular append to FormControl errors 
Javascript :: nodejs validate bnb wallet address 
Javascript :: javascript cargar un html 
Javascript :: imagemagick javascript 
Javascript :: jquery to javascript converter online 
Javascript :: shift reduce parser demo 
Javascript :: reactstrap img bytes 
Javascript :: Run a second function only after the first function is completely finished 
Javascript :: Creating an unnamed function 
Javascript :: proet javascript web 
Javascript :: styleurls component angular node_modules 
Javascript :: javascript factorial with closure 
Javascript :: generate tabuada java script 
Javascript :: intro to graphs with js 
Javascript :: jquery on scroll x pixels 
Javascript :: package.json files property local 
Javascript :: unexpected template string expression no-template-curly-in-string react 
Javascript :: george will turn g years old in year k 
Javascript :: basketball socket io 
Javascript :: How can I display an image and text from an array on a webpage? Ask Question 
Javascript :: check textbox value on ng-change value == in angular 
Javascript :: Maths help you save money 
Javascript :: lookupedit devexpress get specific row 
Javascript :: if you run a script.js with the code, how do you access the value passed to "var" inside script.js ... 
Javascript :: deploy angular app on google app engine 
Javascript :: universal apollo kit 
Javascript :: adjust() js 
Javascript :: Why is #_=_ appended to the redirect URI? passport facebook 
Javascript :: kendo jquery listview 
Javascript :: disable save image option 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =