m1entus / MZFormSheetPresentationController

MZFormSheetPresentationController provides an alternative to the native iOS UIModalPresentationFormSheet, adding support for iPhone and additional opportunities to setup UIPresentationController size and feel form sheet.
MIT License
974 stars 145 forks source link

Question with autolayout: adaptative size #42

Closed Vinzius closed 8 years ago

Vinzius commented 8 years ago

Hello,

First, thank you for this library. I have a question regarding its use with autolayout.

I don't see how to go around the contentViewSize of MZFormSheetPresentationController in order to let autolayout handle the sizes.

Example 1: I have a view with a label, text = "hello world". I pin the label to the its superview edges. So I expect the presented view to have a small size.

Example 2: I want the width of my view to be 80% of the screen.

Thanks!

m1entus commented 8 years ago

Autolayout will not be available to handle contentViewSize, even on apple controls for exaple popoverPresentationController you are not able to do it. You can calculate label size and manually change content size of presenter controller. You would have to pin it to presentedView property of presentation controller which is superview above content view

Vinzius commented 8 years ago

It was my fear, thanks. Too bad :-(

I like to use autolayout (as Apple is pushing for it), but this kind of problem doesn't help...