fixed: settings menu accidentally resized on iPad

This commit is contained in:
TrueZhuanjia committed 2025-09-25 16:22:27 +08:00
1 parent ac0aa29578
commit acd4a04076
1 file changed
+7 -1
@@ -1650,6 +1650,8 @@ static NSMutableSet* hostList;
// [settingsViewController updateResolutionTable]; // [settingsViewController updateResolutionTable];
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleMenuResize:)]; UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleMenuResize:)];
longPress.delaysTouchesBegan = false;
longPress.delaysTouchesEnded = false;
[self.view addGestureRecognizer:longPress]; [self.view addGestureRecognizer:longPress];
@@ -1657,6 +1659,8 @@ static NSMutableSet* hostList;
SettingsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"settingsViewController"]; SettingsViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"settingsViewController"];
// 强制加载视图 // 强制加载视图
__unused UIView *view = viewController.view; __unused UIView *view = viewController.view;
snapshot = nil;
} }
-(void)viewDidLayoutSubviews{ -(void)viewDidLayoutSubviews{
@@ -2228,8 +2232,10 @@ static NSMutableSet* hostList;
if(gesture.state == UIGestureRecognizerStateChanged){ if(gesture.state == UIGestureRecognizerStateChanged){
if(snapshot) snapshot.center = CGPointMake(limitedWidth, snapshot.center.y); if(snapshot) snapshot.center = CGPointMake(limitedWidth, snapshot.center.y);
} }
if(gesture.state == UIGestureRecognizerStateEnded || gesture.state == UIGestureRecognizerStateCancelled){ if(gesture.state == UIGestureRecognizerStateEnded){
if(!snapshot) return;
[snapshot removeFromSuperview]; [snapshot removeFromSuperview];
snapshot = nil;
self.revealViewController.rearViewRevealWidth = limitedWidth; self.revealViewController.rearViewRevealWidth = limitedWidth;
[self.revealViewController setupNavigationBar]; [self.revealViewController setupNavigationBar];
if(self.revealViewController.isStreaming) [self.revealViewController buttonsInStreaming]; if(self.revealViewController.isStreaming) [self.revealViewController buttonsInStreaming];