使用以下:
[self.actionSheetPostOptions showFromBarButtonItem:self.navigationItem.rightBarButtonItem animated:YES];
Run Code Online (Sandbox Code Playgroud)
也试过了
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil
message:nil
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *actnCamera = [UIAlertAction actionWithTitle:@"Camera" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
}];
UIAlertAction *actnLibrary = [UIAlertAction actionWithTitle:@"Library" style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
}];
[alertController addAction:actnLibrary];
[alertController addAction:actnCamera];
[alertController setModalPresentationStyle:UIModalPresentationPopover];
UIPopoverPresentationController *popPresenter = [alertController
popoverPresentationController];
popPresenter.barButtonItem = self.navigationItem.rightBarButtonItem;
[self presentViewController:alertController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
但在解雇时仍然遇到同样的问题.
更新iOS 11:iOS 11中不再存在此问题.
| 归档时间: |
|
| 查看次数: |
667 次 |
| 最近记录: |