Я пытаюсь показать представление с помощью popover. Поскольку UIPopoverController не работает на IPhone, я использую WEPopoverController.WEPopoverController показать представление и после второго закрыл его
Мой код:
UIViewController *controller = [[UIStoryboard storyboardWithName:@"Main" bundle:nil]instantiateViewControllerWithIdentifier:@"GetDateController"];
controller.modalPresentationStyle = UIModalPresentationPopover;
WEPopoverController *pop = [[WEPopoverController alloc] initWithContentViewController:controller];
pop.delegate = self;
CGRect screen = [[UIScreen mainScreen]bounds];
CGRect r = CGRectMake(8, 8, screen.size.width-8, 57);
pop.popoverContentSize = r.size;
[pop presentPopoverFromRect:CGRectMake(200, 100, 0, 0) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
Когда я запустить программу, я вижу поп над окном, которое сразу же исчезает. Когда я использую UIPopoverController при сбое программы IPhone, на iPad все работает правильно.
Что мне нужно для WEPopoverController, чтобы заставить его работать?
Alexander.
Теперь popover возможен в iPhone начиная с iOS8. Вы можете использовать - (UIModalPresentationStyle) adaptivePresentationStyleForPresentationController: (UIPresentationController *) контроллер { return UIModalPresentationNone; }, чтобы показать этот popover на iPhone –