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.

有帮助吗?

解决方案

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

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top