0

我想让UIPopoverController两个方向的大小都等于 iPad 屏幕的大小。怎么做?

4

2 回答 2

0
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
self.contentSizeForViewInPopover = CGSizeMake(width,height);}

这是在您必须在弹出框控制器中设置的视图中设置的

于 2012-04-04T11:32:05.280 回答
0
CGRect popoverRect = [self.view convertRect:[btn frame] 
                                   fromView:[btn superview]];

popoverRect.size.width = self.view.frame.size.width; 
popoverRect.origin.x  = popoverRect.origin.x+150; 
popoverRect.size.height = self.view.frame.size.width;
[self.popoverController 
 presentPopoverFromRect:popoverRect 
 inView:self.view 
 permittedArrowDirections:UIPopoverArrowDirectionLeft
 animated:YES];
于 2012-04-04T10:48:08.877 回答