2012-08-07 130 views
0
CGRect rect = CGRectMake(0, 0, 1050, 900); 

[wineAdminPopup presentPopoverFromRect:rect inView:master.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES]; 

嗨我把上面的代码在tableview中作出弹出窗口。但是它不会在整个屏幕上弹出。如果我想将它置于iPad屏幕中,并且中间没有箭头或箭头。我该怎么做。提前致谢。iPad:弹出式窗口被调整大小iOS

回答

1

presentPopoverFromRect:...中的rect参数指定用于锚定弹出窗口的矩形,而不是所呈现的弹出窗口的大小。这将通过在弹出窗口的内容视图控制器上设置contentSizeForViewInPopover来指定。

如果你不想箭头,不需要popovers的具体行为,那么你可以 出示您的视图控制器模态:

controller.modalPresentationStyle = UIModalPresentationFullScreen; // or UIModalPresentationFormSheet 
[self.navigationController presentModalViewController:controller animated:YES]; 
0

presentModalViewController在iOS 6以上已被弃用。使用presentViewController:yourViewController animated:YES completion:nil(参数animatedcompletion可以根据您的要求设置)。此外,如果您想调整您的视图控制器的大小,您需要更改self.view.frame,并且下次您的视图控制器将具有该大小。