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:
<img width="437" alt="image" src="https://github.com/facebook/react-native/assets/8179987/3c993c1b-6370-4cee-b5b1-e50e3f191dac">

After:
<img width="437" alt="image" src="https://github.com/facebook/react-native/assets/8179987/8be83e73-36e7-4075-9b74-64829b242020">

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[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
This commit is contained in:
zerosrat
2023-07-11 10:33:51 -07:00
committed by Facebook GitHub Bot
parent 6f853cc445
commit 5ba8de05b5
@@ -183,7 +183,9 @@ RCT_EXPORT_MODULE()
- (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];