mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix(dark-mode): window and page background color
This commit is contained in:
@@ -32,6 +32,7 @@ const ROOT_VIEW_CSS_CLASSES = [
|
||||
`${CSS_CLASS_PREFIX}${IOS_PLATFORM}`
|
||||
];
|
||||
const getVisibleViewController = ios.getVisibleViewController;
|
||||
const majorVersion = ios.MajorVersion;
|
||||
|
||||
// NOTE: UIResponder with implementation of window - related to https://github.com/NativeScript/ios-runtime/issues/430
|
||||
// TODO: Refactor the UIResponder to use Typescript extends when this issue is resolved:
|
||||
@@ -44,8 +45,8 @@ const Responder = (<any>UIResponder).extend({
|
||||
// NOOP
|
||||
}
|
||||
}, {
|
||||
protocols: [UIApplicationDelegate]
|
||||
}
|
||||
protocols: [UIApplicationDelegate]
|
||||
}
|
||||
);
|
||||
|
||||
class NotificationObserver extends NSObject {
|
||||
@@ -163,11 +164,19 @@ class IOSApplication implements IOSApplicationDefinition {
|
||||
}
|
||||
|
||||
this._window = UIWindow.alloc().initWithFrame(UIScreen.mainScreen.bounds);
|
||||
|
||||
// TODO: add CompatibilityColor.backgroundColor;
|
||||
let backgroundColor;
|
||||
if (majorVersion <= 12) {
|
||||
backgroundColor = UIColor.whiteColor;
|
||||
} else {
|
||||
backgroundColor = UIColor.systemBackgroundColor;
|
||||
}
|
||||
|
||||
// TODO: Expose Window module so that it can we styled from XML & CSS
|
||||
this._window.backgroundColor = UIColor.whiteColor;
|
||||
this._window.backgroundColor = backgroundColor;
|
||||
|
||||
this.notifyAppStarted(notification);
|
||||
|
||||
}
|
||||
|
||||
public notifyAppStarted(notification?: NSNotification) {
|
||||
|
||||
Reference in New Issue
Block a user