ボタンの下またはウインドウの中央にUIPopoverPresentationControllerとして表示コントローラを表示しようとしています。しかし、常にフルウィンドウのモーダルポップアップとして表示されます。UIPopoverPresentationController全画面モーダルポップアップを常に表示
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
MySecondViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"Pop"];
// present the controller
// on iPad, this will be a Popover
// on iPhone, this will be an action sheet
controller.modalPresentationStyle = UINavigationControllerOperationPop;
[self presentViewController:controller animated:YES completion:nil];
controller.preferredContentSize = CGSizeMake(280, 230);
// configure the Popover presentation controller
UIPopoverPresentationController *popController = [controller popoverPresentationController];
popController.permittedArrowDirections = UIPopoverArrowDirectionUp;
popController.delegate = self;
// in case we don't have a bar button as reference
popController.sourceView = self.showPop;
popController.sourceRect = CGRectMake(384, -120, 280, 230);
-(UIModalPresentationStyle)adaptivePresentationStyleForPresentationController:(UIPresentationController *)controller {
return UIModalPresentationNone;
}
私はバーのボタンを使用するつもりです...それはフルスクリーンで私をtablewiew示しています...私はハッサンアフタブ –
@SurajSukale @ ...何をすべき、それは、あなたのために遅すぎるかもしれませんおそらく誰かがこのコメントから利益を得ることができます。デリゲートをcontroller.popoverPresentationControllerに代入し、デリゲートで 'adaptivePresentationStyle(for:UIPresentationController)'を実装し、 'UIModalPresentationStyleNone'という値を返します。 – Lukas1