我正在开发一个应用程序,需要显示带有图像的弹出窗口,我使用了UIPopoverController,但是在iOS8上,这个类已经被弃用,Apple建议使用UIPopoverPresentationController代替,但是当我尝试显示弹出窗口时,屏幕变成了黑色。你能帮我吗?谢谢。
以下是我尝试将名为“popVC”的视图控制器作为弹出窗口打开的代码。 *vernazaImagenDetalle是UIViewController子类
以下是我尝试将名为“popVC”的视图控制器作为弹出窗口打开的代码。 *vernazaImagenDetalle是UIViewController子类
vernazaImagenDetalle *vc =
[self.storyboard instantiateViewControllerWithIdentifier:@"popVC"];
vc.modalPresentationStyle = UIModalPresentationPopover;
[self presentViewController:vc animated: YES completion: nil];
UIButton *boton=(UIButton*)sender;
NSLog(@"tag %ld",(long)boton.tag);
UIPopoverPresentationController *presentationController =
[vc popoverPresentationController];
presentationController.permittedArrowDirections =0;
presentationController.sourceView =boton;
presentationController.sourceRect = CGRectMake(self.stringContenido.frame.size.width/2,(250+self.stringContenido.contentOffset.y),1,1);