diff --git a/iOS/GBStatesViewController.m b/iOS/GBStatesViewController.m index 0ea9989e3..15762513b 100644 --- a/iOS/GBStatesViewController.m +++ b/iOS/GBStatesViewController.m @@ -38,10 +38,8 @@ - (void)viewDidLoad { [super viewDidLoad]; - UIVisualEffect *effect = [UIBlurEffect effectWithStyle:(UIBlurEffectStyle)UIBlurEffectStyleProminent]; - self.view = [[UIVisualEffectView alloc] initWithEffect:effect]; self.view.bounds = CGRectMake(0, 0, 0x300, 0x300); - UIView *root = ((UIVisualEffectView *)self.view).contentView; + UIView *root = self.view; for (unsigned i = 0; i < 9; i++) { unsigned x = i % 3; unsigned y = i / 3; @@ -115,20 +113,6 @@ [self presentViewController:controller animated:true completion:nil]; } -- (void)viewWillLayoutSubviews -{ - [super viewWillLayoutSubviews]; - if ([UIDevice currentDevice].userInterfaceIdiom != UIUserInterfaceIdiomPad) { - UIView *root = ((UIVisualEffectView *)self.view).contentView; - CGRect frame = root.frame; - UIEdgeInsets insets = [UIApplication sharedApplication].keyWindow.safeAreaInsets; - frame.size.height = self.view.frame.size.height - insets.bottom; - frame.size.width = self.view.frame.size.width - insets.left - insets.right; - frame.origin.x = insets.left; - root.frame = frame; - } -} - - (NSString *)title { return @"Save States"; diff --git a/iOS/GBViewController.m b/iOS/GBViewController.m index 19fc5c400..222cf6623 100644 --- a/iOS/GBViewController.m +++ b/iOS/GBViewController.m @@ -426,6 +426,11 @@ static void rumbleCallback(GB_gameboy_t *gb, double amp) - (void)openStates { UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:[[GBStatesViewController alloc] init]]; + UIVisualEffect *effect = [UIBlurEffect effectWithStyle:(UIBlurEffectStyle)UIBlurEffectStyleProminent]; + UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect]; + effectView.frame = controller.view.bounds; + effectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [controller.view insertSubview:effectView atIndex:0]; UIBarButtonItem *close = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self