【发布时间】:2023-03-25 16:43:01
【问题描述】:
我正在尝试在我的 iPad 应用程序中显示一些 UIModalFormSheets。它工作没有任何问题,除了一件事:
当我的 iPad 处于横向模式时,我的模式表单正在移动到屏幕的中心,然后 会旋转到适当的角度。我想要的只是根据视图模式(纵向或横向)以直角呈现模态表单,在显示之前,这样用户就不会看到这种旋转。
我已经尝试了modalTransitionStyle 和modalPresentationStyle 的所有模式,但似乎没有什么能阻止模式表单在显示后旋转。
这就是我正在做的:
NewFavouriteSheet *newFavouriteSheet = [[NewFavouriteSheet alloc]
initWithNibName:@"NewFavouriteSheet" bundle:nil];
newFavouriteSheet.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:newFavouriteSheet animated:NO];
有人对如何以正确的方式显示模态视图有建议吗?
感谢您的帮助。
【问题讨论】:
标签: cocoa-touch rotation modal-dialog uimodalpresentationformsh