如何使用IOS 8 XCode 6 beta从Popover中的按钮关闭UIPopover
发布时间:2020-12-14 18:08:59 所属栏目:百科 来源:网络整理
导读:我设法使用UIPopoverPresentationController显示popover,因为UOSopoverController在 IOS 8中已被弃用,但现在我想从popover中关闭按钮上的popover. 怎么可以被解雇? 解决方法 使用UIViewController的presentsViewController属性来关闭. 例如:出席 vc.modalP
我设法使用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]; 希望这可以帮助. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |