Custom size for Modal View loaded with Form Sheet presentation

前端 未结 10 787
予麋鹿
予麋鹿 2021-02-01 12:44

I\'m trying to load a UIViewController in iPad with Form Sheet presentation. The problem is the size of this new view, i put the size values in the IBuilder but the modal view t

10条回答
  •  遥遥无期
    2021-02-01 13:34

    EDIT

    Use preferredContentSize.

    Old

    You can try this for show view in center

    HelpViewController * viewController = [[[HelpViewController alloc] init] autorelease];
    viewController.modalPresentationStyle=UIModalPresentationFormSheet;
    viewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    [self presentViewController:viewController animated:YES completion:^{
        viewController.view.superview.frame = CGRectMake(0, 0, 200, 200);
        viewController.view.superview.center = self.view.center;
    }];
    

提交回复
热议问题