실제로 UIModalPresentationPageSheet로 표시되는보기 컨트롤러의 크기를 조정할 수 있습니다.
<!--The header file-->
@interface MyViewController: ViewController{
//Used to store the bounds of the viewController
CGRect realBounds;
}
<!--In the .m file-->
//viewDidLoad gets called before viewWillAppear, so we make our changes here
-(void)viewDidLoad{
//Here you can modify the new frame as you like. Multiply the
//values or add/subtract to change the size of the viewController.
CGRect newFrame = CGRectMake(self.view.frame.origin.x,
self.view.frame.origin.y,
self.view.frame.size.width,
self.view.frame.size.height);
[self.view setFrame:newFrame];
//Now the bounds have changed so we save them to be used later on
_realBounds = self.view.bounds;
[super viewDidLoad];
}
//viewWillAppear gets called after viewDidLoad so we use the changes
//implemented above here
-(void)viewWillAppear:(BOOL)animated{
//UIModalpresentationPageSheet is the superview and we change
//its bounds here to match the UIViewController view's bounds.
[super viewWillAppear:animated];
self.view.superview.bounds = realBounds;
}
을 그리고 당신은 UIModalPresentationPageSheet이 뷰 컨트롤러를 표시 : 그것을 위해 당신은 클래스에 다음과 같은 사용자 정의 뷰 컨트롤러 클래스를 생성하고 추가해야합니다. 그리고 그게 다야. 이 게시물은 iOS 5.1.1 및 iOS 6에서 작동합니다.
'UIModalPresentationFormSheet'에는 키보드 숨기기에 문제가 있습니다. 'UITextField'에서'resignFirstResponder'를 호출하면 키보드가 닫히지 않습니다. – Fry
http://stackoverflow.com/a/4850751/2832188 – ManicMonkOnMac