diff --git a/LEEThemeDemo/LEEThemeDemo/AppDelegate.m b/LEEThemeDemo/LEEThemeDemo/AppDelegate.m index 7797e64..ad53478 100644 --- a/LEEThemeDemo/LEEThemeDemo/AppDelegate.m +++ b/LEEThemeDemo/LEEThemeDemo/AppDelegate.m @@ -42,6 +42,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.window = [[MainWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + self.window.backgroundColor = [UIColor whiteColor]; + [self.window makeKeyAndVisible]; self.window.rootViewController = [[TabBarController alloc] init]; diff --git a/LEEThemeDemo/LEEThemeDemo/MainWindow.m b/LEEThemeDemo/LEEThemeDemo/MainWindow.m index 3615e9e..d636f03 100644 --- a/LEEThemeDemo/LEEThemeDemo/MainWindow.m +++ b/LEEThemeDemo/LEEThemeDemo/MainWindow.m @@ -39,7 +39,7 @@ - (instancetype)initWithFrame:(CGRect)frame - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { [super traitCollectionDidChange:previousTraitCollection]; - NSLog(@"%ld", (long)self.traitCollection.userInterfaceStyle); + // 根据系统样式变化 重新启用相应的主题 以达到同步的效果 if (@available(iOS 13.0, *)) { switch (self.traitCollection.userInterfaceStyle) {