我设法使用UIPopoverPresentationController显示popover,因为UOSopoverController在
IOS 8中已被弃用,但现在我想从popover中关闭按钮上的popover.
怎么可以被解雇?
解决方法
使用UIViewController的presentsViewController属性来关闭.
例如:出席
例如:出席
vc.modalPresentationStyle = UIModalPresentationPopover; vc.preferredContentSize = aPreffferedSize; UIPopoverPresentationController *popcontroller = vc.popoverPresentationController; popcontroller.barButtonItem = [[UIBarButtonItem alloc] initWithCustomView:view]; popcontroller.permittedArrowDirections = UIPopoverArrowDirectionAny; popcontroller.delegate = self; [self presentViewController:vc animated:YES completion:nil];
要以编程方式解雇,
[[vc presentingViewController] dismissViewControllerAnimated:YES completion:NULL];
希望这可以帮助.