私は画像でポップオーバーを表示する必要があるアプリを開発しています。私は UIPopoverController を使用しましたが、現在 iOS8 ではこのクラスは非推奨であり、Apple は代わりに UIPopoverPresentationController を使用することを提案していますが、ポップオーバーを表示しようとすると黒い画面が表示されます。手伝って頂けますか?ありがとう。
これは、「popVC」と呼ばれるView Controllerをポップオーバーとして開こうとするコードです。*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);