Question

I am developing an iPad application using storyboard.For my application i developed a modal view by setting presentation style of the modal view controller to Form sheet.Is any option available in storyboard for reduce the size of the modal view.

Was it helpful?

Solution

I think the better option is to set the custom size by programatically.

objectiveC:

- (void)viewWillLayoutSubviews{
    [super viewWillLayoutSubviews];   
    self.view.superview.bounds = CGRectMake(0, 0, <width>, <height>);
}

Swift:

override func viewWillLayoutSubviews() {
    super.viewWillLayoutSubviews()
    self.view.superview?.bounds = CGRect(x: 0, y: 0, width: 300, height: 400)
}

Put this code inside Modal view controller

OTHER TIPS

When you control-drag the segue in the Storyboard to the modal view, you can choose the segue to be modal. Once you select that option, you can resize the modal view on the right-hand panel (size inspector). I believe you can also do it directly on the storyboard by dragging the edges.

Select the view controller in the storyboard, open the Attributes inspector and set the Size to Freeform. Use the Size inspector to set width and height of the view controller.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top