0

背景がぼやけた UITableViewController をフォーム シートとして現在のコンテキストに表示するにはどうすればよいですか?

- (void)viewDidLoad {

   self.tableView.backgroundColor = [UIColor clearColor];
   self.tableView.backgroundView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
}

で設定されたiPhoneで、フルスクリーンで正常に動作しますUIModalPresentationOverCurrentContext

modalPresentationStyleただし、iPad でフォーム シートとして表示する場合は、に設定する必要がありUIModalPresentationFormSheetます。

両方を設定するにはどうすればよいですか?

4

2 に答える 2

0

を使用する必要があることがわかっUIModalPresentationPopoverたので、View Controllerを にmodalPresentationStyle設定できます。popoverPresentationColorclearColor

 FAGalleryTableViewController *vc = (FAGalleryTableViewController *)[segue destinationViewController];

        if ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad ) {
            vc.modalPresentationStyle = UIModalPresentationPopover;
            vc.popoverPresentationController.sourceView = _storeButton;
            vc.popoverPresentationController.backgroundColor = [UIColor clearColor];
            vc.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionDown;
            vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    }
于 2015-06-13T07:32:08.377 に答える