作者:于英豪H | 来源:互联网 | 2023-05-18 22:07
AnyoneisgettingthismessagewhiletryingtoshowUIActionSheetfrompopover?有人在从弹出窗口显示UIActionSh
Anyone is getting this message while trying to show UIActionSheet from popover?
有人在从弹出窗口显示UIActionSheet时收到这个消息吗?
Your application has presented a UIAlertController () of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.
您的应用程序提供了一个UIAlertController()样式的UIAlertControllerStyleActionSheet。UIAlertController的modalPresentationStyle就是UIModalPresentationPopover。您必须通过警报控制器的popoverPresentationController为该弹窗提供位置信息。您必须提供sourceView和sourceRect或barButtonItem。如果在显示警报控制器时不知道该信息,可以在UIPopoverPresentationControllerDelegate方法-prepareForPopoverPresentation中提供。
Previously to the GM I used some workaround for converting the UIActionSheet to UIAlertController and this is working fine. However it seems that Apple tried to solve the UIActionSheet issues and I didn't want to use my workaround - but it seems that I have no choice...
之前,我使用了一些变通方法将UIActionSheet转换为UIAlertController,这是正常的。然而,似乎苹果公司试图解决UIActionSheet的问题,我不想用我的解决方案——但似乎我别无选择……
5 个解决方案