我想使用 Storyboard中的 View Controller 两次(干!)。然而,在一种情况下,我希望它是全屏的,而在另一种情况下,我希望它大约是屏幕的 3/4(在另一个 VC 内)。我怎样才能像那样重用它?
最佳答案
有一个很棒的图书馆。我没有创建它,但我使用过它:https://github.com/m1entus/MZFormSheetController
这里是部分片段
MZFormSheetSegue *formSheetSegue = (MZFormSheetSegue *)segue;
MZFormSheetController *formSheet = formSheetSegue.formSheetController;
formSheet.transitionStyle = MZFormSheetTransitionStyleBounce;
formSheet.shouldCenterVertically = YES;
formSheet.cornerRadius = 0;
formSheet.presentedFormSheetSize = CGSizeMake(290, 290);
所以我的想法是,当你进行 segue 时,如果你想要全尺寸,那么正常进行 segue。如果您想要更小的尺寸,请按照我在上面的代码片段中显示的方式使用。阅读自述文件和示例。
如果您在尝试 git 项目时需要进一步的帮助,我将留给您提出更多问题,而不是继续下去。
关于ios - 如何在不同大小的 Storyboard 中使用相同的 ViewController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25901237/