Skip to content

hzlu/react-native-root-view-background-color

 
 

Repository files navigation

react-native-set-rootview-bgcolor

This lib is fork kev-chen/react-native-root-view-background-color, add ts support.

Getting started

yarn add react-native-set-rootview-bgcolor

RN >= 0.60

If you are using RN >= 0.60, only run pod install from the ios directory. Then rebuild your project.

RN < 0.60

For RN < 0.60, you need to link the dependency using react-native link:

react-native link react-native-set-rootview-bgcolor

Then run pod install from the ios directory and rebuild your project.

Usage

import RootViewBackgroundColor from 'react-native-set-rootview-bgcolor';


// Set the Root View background color to black
RootViewBackgroundColor.setBackground(0, 0, 0, 1);

// Set the Root View background color to white
RootViewBackgroundColor.setBackground(255, 255, 255, 1);

Note: Requires minSdkVersion = 21 or newer.

About

React Native module to set RootView background color

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 59.8%
  • Objective-C 18.3%
  • Ruby 18.0%
  • JavaScript 3.9%