我将我所有的UIActionSheet和UIAlertView带UIAlertController。
我的问题是当我尝试呈现UIAlertControllerActionSheet样式时。这是我的代码:
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Title"
message:@"My message"
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil];
[alert addAction:cancelAction];
UIAlertAction *OKAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
[alert addAction:OKAction];
UIAlertAction *destroyAction = [UIAlertAction actionWithTitle:@"Destroy" style:UIAlertActionStyleDestructive handler:nil];
[alert addAction:destroyAction];
UIPopoverPresentationController *popPresenter = [alert popoverPresentationController];
popPresenter.sourceView = self.view;
popPresenter.sourceRect = self.view.bounds;
[self presentViewController:alert animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
这是错误:
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you …Run Code Online (Sandbox Code Playgroud)