문제

I am trying to resize a popover UIView. The following is the code I'm using to make the clip:

-(void)viewWillLayoutSubviews
{
 [super viewWillLayoutSubviews];
 CGRect box;
 box = self.view.frame;
 box.size.height -= 100;
 [self.view setFrame:box];
}

This gives me the following result:

enter image description here

The self.view background is white. What do I need to do in order to clip the portion marked as 'X'. The UIView, self.view is the topmost view of the UIViewController.

Any help is appreciated!!

도움이 되었습니까?

해결책

In the controller for the view, you can define preferredContentSize. Like this

self.preferredContentSize = CGSizeMake(width, height);

*Ninja edit: Pre-iOS7, you would use self.contentSizeForViewInPopover

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top