From 5ba8de05b5e6c170b84b44979e7bbc576442eafb Mon Sep 17 00:00:00 2001 From: zerosrat Date: Tue, 11 Jul 2023 10:33:51 -0700 Subject: [PATCH] fix(ios): set top of perf monitor to statusbar height (#38262) Summary: Update RCTPerfMonitor.mm Change the top offset of perf monitor component. As it is overlapped by dynamic island of iPhone 14 Pro series. Before: image After: image ## Changelog: [iOS] [Fixed] - Change the top of perf monitor component. Pull Request resolved: https://github.com/facebook/react-native/pull/38262 Test Plan: noop Reviewed By: javache Differential Revision: D47325450 Pulled By: NickGerleman fbshipit-source-id: 6108db752945712e6cb770f5dd49e71df87d3f52 --- packages/react-native/React/CoreModules/RCTPerfMonitor.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm index 307161f5b3e4c5..46463a0f9c5505 100644 --- a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm +++ b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm @@ -183,7 +183,9 @@ - (UIPanGestureRecognizer *)gestureRecognizer - (UIView *)container { if (!_container) { - _container = [[UIView alloc] initWithFrame:CGRectMake(10, 25, 180, RCTPerfMonitorBarHeight)]; + CGSize statusBarSize = RCTSharedApplication().statusBarFrame.size; + CGFloat statusBarHeight = statusBarSize.height; + _container = [[UIView alloc] initWithFrame:CGRectMake(10, statusBarHeight, 180, RCTPerfMonitorBarHeight)]; _container.layer.borderWidth = 2; _container.layer.borderColor = [UIColor lightGrayColor].CGColor; [_container addGestureRecognizer:self.gestureRecognizer];