我在我的 viewController 中创建了一个模式对话框。
dialogViewController *dialog = [[dialogViewController alloc] init];
dialog.modalPresentationStyle = UIModalPresentationFormSheet;
dialog.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
dialog.indexPath = indexPath;
dialog.campaignArray = self.campaignArray;
dialog.view.superview.frame = CGRectMake(dialog.view.superview.frame.origin.x+250, dialog.view.superview.frame.origin.y, dialog.view.superview.frame.size.width-250, dialog.view.superview.frame.size.height);
[self presentViewController:dialog animated:YES completion:nil];
以上更改了模态对话框的宽度,但不更改 x 位置。它在 modalDialog 中工作,但随后用户可以看到它正在调整大小。