Я пытаюсь показать контроллер представления как 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 на весь экран ... Что я должен сделать ... @ Hassan Aftab –
@SurajSukale, это может быть слишком поздно для вас, но, возможно, кто-то еще может воспользоваться этим комментарием. Вы должны назначить делегата контроллеру.popoverPresentationController и в методе реализации делегата 'adaptivePresentationStyle (для: UIPresentationController)', возвращая значение 'UIModalPresentationStyleNone' – Lukas1