Popover with ModalPresentationStyle is not centered in iOS 7 iPad

前端 未结 6 1364
悲哀的现实
悲哀的现实 2021-01-31 19:18

I have a problem with iOS 7 that seems to be a bug or I just don\'t do something right. I have modalViewController that appears as a popover on iPad with ModalPresentationStyle.

6条回答
  •  执笔经年
    2021-01-31 19:46

    It's the same for me... I don't know yet how to solve it. I'm currently working in that issue so anything I get I'll share it!

    This is my code.

    -(IBAction)showGeneralSettings:(id)sender{
    
    self.generalSettingsVC = [[GeneralSettingsViewController alloc] initWithNibName:@"GeneralSettingsView" bundle:nil];
    
    //Present the view controller as a modal with a custom size (important to do after presenting it)
    self.generalSettingsVC.modalPresentationStyle = UIModalPresentationFormSheet;
    
    [self presentViewController:self.generalSettingsVC animated:YES completion:nil];
    
    self.generalSettingsVC.view.superview.frame = CGRectMake(0, 0, 497, 375);
    self.generalSettingsVC.view.superview.center = self.view.center;
    

    }

提交回复
热议问题