diff --git a/iOS/GBLayout.m b/iOS/GBLayout.m index 4da2d0a..9cd2c43 100644 --- a/iOS/GBLayout.m +++ b/iOS/GBLayout.m @@ -12,6 +12,10 @@ static double StatusBarHeight(void) UIEdgeInsets insets = window.safeAreaInsets; ret = MAX(MAX(insets.left, insets.right), MAX(insets.top, insets.bottom)) ?: 20; [window setHidden:true]; + if (!ret && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + ret = 32; // iPadOS is buggy af + } + NSLog(@"height = %f", ret); } }); return ret; @@ -47,7 +51,7 @@ static bool HasHomeBar(void) } _minY = StatusBarHeight() * _factor; - _cutout = _minY <= 24 * _factor? 0 : _minY; + _cutout = (_minY <= 24 * _factor || [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)? 0 : _minY; if (HasHomeBar()) { _homeBar = 21 * _factor; diff --git a/iOS/GBMenuViewController.m b/iOS/GBMenuViewController.m index f02a158..802de1b 100644 --- a/iOS/GBMenuViewController.m +++ b/iOS/GBMenuViewController.m @@ -156,8 +156,12 @@ static NSString *const tips[] = { limitedToNumberOfLines:3].size; size.width = ceil(size.width); _tipLabel.frame = (CGRect){{8, 8}, size}; + unsigned topInset = view.window.safeAreaInsets.top; + if (!topInset && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { + topInset = 32; // iPadOS is buggy af + } _effectView.frame = (CGRect) { - {round((outerSize.width - size.width - 16) / 2), view.window.safeAreaInsets.top + 12}, + {round((outerSize.width - size.width - 16) / 2), topInset + 12}, {size.width + 16, size.height + 16} }; }