Skip to content

Commit

Permalink
Make the root view background color explicit
Browse files Browse the repository at this point in the history
Summary:
The default white background for the root view causes an unattractive flash when loading any app with a non-white background.  Almost every developer has to search for how to fix it.

This change makes the background color explicit in the file, so it can be easily change to match the color of the splash screen and the main screen without having to search for it.

**Test plan (required)**
Launched my app and it still has a white flash for the background before loading the app.  I changed the background colors to other values and the flash was that color.
Closes #7570

Differential Revision: D3303451

Pulled By: vjeux

fbshipit-source-id: 61dbab768095c430bcb583bafb57575a7d767e6f
  • Loading branch information
shaneosullivan authored and Facebook Github Bot 1 committed May 15, 2016
1 parent 433c0e8 commit fa5d1fe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions local-cli/generator-ios/templates/app/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
moduleName:@"<%= name %>"
initialProperties:nil
launchOptions:launchOptions];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
Expand Down

0 comments on commit fa5d1fe

Please sign in to comment.