React Native - Set RootView Background Color
In the RootView of a React Native app, the default background color is white. We can change this to another color by following the steps below.
Note: Changing the background color may resolve issues related to launch screen flicker/flash and background color during orientation change.
iOS
- Open
AppDelegate.m
located inPROJECT_DIR/ios/AppName/
- Locate line that matches or is similar to:
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
- Adjust UIColor values!
UIColor is a handy website that can be used to convert HEX & RGB colors to UIColor for both Objective-C and Swift.
Mobile DevPublished