Skip to content

Commit

Permalink
fix(ios): set top of perf monitor to statusbar height (#38262)
Browse files Browse the repository at this point in the history
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: #38262

Test Plan: noop

Reviewed By: javache

Differential Revision: D47325450

Pulled By: NickGerleman

fbshipit-source-id: 6108db752945712e6cb770f5dd49e71df87d3f52
  • Loading branch information
zerosrat authored and facebook-github-bot committed Jul 11, 2023
1 parent 6f853cc commit 5ba8de0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-native/React/CoreModules/RCTPerfMonitor.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 5ba8de0

Please sign in to comment.