I've a modal view controller that I show with UIModalPresentationPageSheet. The problem is that his default size is too large for my content: so I want to resize is frame to adjust in according with my content.
Does anyone know a way/trick to do this ?
Thanks
This works for resizing a view controller that's presented as
UIModalPresentationFormSheet
. I would give this a try, I'm not sure if it'll work or not:You can't resize a UIModalPresentationPageSheet because its size is not modifable.
Actually you can resize the view controller that gets presented with UIModalPresentationPageSheet. To do it you need to create a custom view controller class and add the following to the class:
And then you display this view controller with a UIModalPresentationPageSheet. And that's it. This does work for iOS 5.1.1 and iOS 6 as of the date of this post.