@@ -73,8 +73,15 @@ - (void)setBridge:(RCTBridge *)bridge
73
73
dispatch_async (dispatch_get_main_queue (), ^{
74
74
self->_showDate = [NSDate date ];
75
75
if (!self->_window && !RCTRunningInTestEnvironment ()) {
76
- CGFloat screenWidth = [UIScreen mainScreen ].bounds .size .width ;
77
- self->_window = [[UIWindow alloc ] initWithFrame: CGRectMake (0 , 0 , screenWidth, 22 )];
76
+ CGSize screenSize = [UIScreen mainScreen ].bounds .size ;
77
+ if (screenSize.height == 812 /* iPhone X */ ) {
78
+ self->_window = [[UIWindow alloc ] initWithFrame: CGRectMake (0 , 0 , screenSize.width, 60 )];
79
+ self->_label = [[UILabel alloc ] initWithFrame: CGRectMake (0 , 30 , self ->_window.bounds.size.width, 30 )];
80
+ } else {
81
+ self->_window = [[UIWindow alloc ] initWithFrame: CGRectMake (0 , 0 , screenSize.width, 22 )];
82
+ self->_label = [[UILabel alloc ] initWithFrame: self ->_window.bounds];
83
+ }
84
+ [self ->_window addSubview: self ->_label];
78
85
#if TARGET_OS_TV
79
86
self->_window .windowLevel = UIWindowLevelNormal + 1 ;
80
87
#else
@@ -83,11 +90,8 @@ - (void)setBridge:(RCTBridge *)bridge
83
90
// set a root VC so rotation is supported
84
91
self->_window .rootViewController = [UIViewController new ];
85
92
86
- self->_label = [[UILabel alloc ] initWithFrame: self ->_window.bounds];
87
93
self->_label .font = [UIFont systemFontOfSize: 12.0 ];
88
94
self->_label .textAlignment = NSTextAlignmentCenter;
89
-
90
- [self ->_window addSubview: self ->_label];
91
95
}
92
96
93
97
self->_label .text = message;
0 commit comments