File tree Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ const ROOT_VIEW_CSS_CLASSES = [
32
32
`${ CSS_CLASS_PREFIX } ${ IOS_PLATFORM } `
33
33
] ;
34
34
const getVisibleViewController = ios . getVisibleViewController ;
35
+ const majorVersion = ios . MajorVersion ;
35
36
36
37
// NOTE: UIResponder with implementation of window - related to https://github.com/NativeScript/ios-runtime/issues/430
37
38
// TODO: Refactor the UIResponder to use Typescript extends when this issue is resolved:
@@ -44,8 +45,8 @@ const Responder = (<any>UIResponder).extend({
44
45
// NOOP
45
46
}
46
47
} , {
47
- protocols : [ UIApplicationDelegate ]
48
- }
48
+ protocols : [ UIApplicationDelegate ]
49
+ }
49
50
) ;
50
51
51
52
class NotificationObserver extends NSObject {
@@ -163,11 +164,19 @@ class IOSApplication implements IOSApplicationDefinition {
163
164
}
164
165
165
166
this . _window = UIWindow . alloc ( ) . initWithFrame ( UIScreen . mainScreen . bounds ) ;
167
+
168
+ // TODO: add CompatibilityColor.backgroundColor;
169
+ let backgroundColor ;
170
+ if ( majorVersion <= 12 ) {
171
+ backgroundColor = UIColor . whiteColor ;
172
+ } else {
173
+ backgroundColor = UIColor . systemBackgroundColor ;
174
+ }
175
+
166
176
// TODO: Expose Window module so that it can we styled from XML & CSS
167
- this . _window . backgroundColor = UIColor . whiteColor ;
177
+ this . _window . backgroundColor = backgroundColor ;
168
178
169
179
this . notifyAppStarted ( notification ) ;
170
-
171
180
}
172
181
173
182
public notifyAppStarted ( notification ?: NSNotification ) {
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ class UIViewControllerImpl extends UIViewController {
148
148
const isReplace = navigationContext . navigationType === NavigationType . replace ;
149
149
150
150
frame . setCurrent ( newEntry , navigationContext . navigationType ) ;
151
-
151
+
152
152
if ( isReplace ) {
153
153
let controller = newEntry . resolvedPage . ios ;
154
154
if ( controller ) {
@@ -282,7 +282,6 @@ class UIViewControllerImpl extends UIViewController {
282
282
}
283
283
}
284
284
285
- const whiteColor = new Color ( "white" ) . ios ;
286
285
export class Page extends PageBase {
287
286
nativeViewProtected : UIView ;
288
287
viewController : UIViewControllerImpl ;
@@ -294,7 +293,17 @@ export class Page extends PageBase {
294
293
super ( ) ;
295
294
const controller = UIViewControllerImpl . initWithOwner ( new WeakRef ( this ) ) ;
296
295
this . viewController = this . _ios = controller ;
297
- controller . view . backgroundColor = whiteColor ;
296
+
297
+ // Make transitions look good
298
+ let backgroundColor ;
299
+ if ( majorVersion <= 12 ) {
300
+ backgroundColor = UIColor . whiteColor ;
301
+ } else {
302
+ backgroundColor = UIColor . systemBackgroundColor ;
303
+ }
304
+
305
+ // TODO: add CompatibilityColor.backgroundColor;
306
+ controller . view . backgroundColor = backgroundColor ;
298
307
}
299
308
300
309
createNativeView ( ) {
You can’t perform that action at this time.
0 commit comments