Skip to content

Commit f9abe96

Browse files
sbuggayfacebook-github-bot
authored andcommitted
Fix RCTDevLoadingView position (facebook#46005)
Summary: Pull Request resolved: facebook#46005 The RCTDevLoadingView is clipped in Mac Catalyst, hiding half of it under the toolbar. This change maintains the behavior on iOS of extending past the dynamic island. {F1803665273} Changelog: [Internal] Reviewed By: shwanton Differential Revision: D61209780 fbshipit-source-id: 6c9c572a9e47a8caf191c40fb53c4a7d43b64281
1 parent bd90a07 commit f9abe96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-native/React/CoreModules/RCTDevLoadingView.mm

+5
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,13 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(
119119
CGFloat windowWidth = window.bounds.size.width;
120120

121121
self->_window = [[UIWindow alloc] initWithWindowScene:window.windowScene];
122+
#if TARGET_OS_MACCATALYST
123+
self->_window.frame = CGRectMake(0, window.safeAreaInsets.top, windowWidth, 20);
124+
self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, windowWidth, 20)];
125+
#else
122126
self->_window.frame = CGRectMake(0, 0, windowWidth, window.safeAreaInsets.top + 10);
123127
self->_label = [[UILabel alloc] initWithFrame:CGRectMake(0, window.safeAreaInsets.top - 10, windowWidth, 20)];
128+
#endif
124129
[self->_window addSubview:self->_label];
125130

126131
self->_window.windowLevel = UIWindowLevelStatusBar + 1;

0 commit comments

Comments
 (0)