我有 ViewController
,当用户点击它的底部时,其他 ViewController
使用 segue Present Modally
弹出。
是否可以为他们提供自定义尺寸?我尝试通过 Use Preferred Explicit Size
选项提供内容大小,但它没有帮助。我希望那个 VC 弹出并从 up 中获取当前 VC 的 70%。
最佳答案
看看这个,如果您需要任何说明,请告诉我。
__weak IBOutlet UIView *conViewers;
- (void)callingOfCustomView:(UIViewController *)showPushedVC
{
[showPushedVC.view setTranslatesAutoresizingMaskIntoConstraints:YES];
showPushedVC.view.frame = conViewers.bounds;
//**>> Add child view into container view
[conViewers addSubview: showPushedVC.view];
[self addChildViewController: showPushedVC];
[showPushedVC didMoveToParentViewController:self];
}
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
ViewersVC *objViewers = [storyboard instantiateViewControllerWithIdentifier:@"ViewersVC"];
[self callingOfCustomView:objViewers];
会尽快更新。
关于ios - 如何将自定义大小设置为以模态方式呈现 ViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41377547/