mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-03 14:12:49 +02:00
Fix the States view header in iOS 16 and newer
This commit is contained in:
@@ -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";
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user