子视图未在ContainerView中滚动-目标C

时间:2018-08-24 10:02:02

标签: objective-c container-view

容器视图固定在屏幕的下半部分,在“按钮”上单击当前容器视图将替换为新的视图控制器。每个子视图的高度都不同。子视图滚动不起作用。我检查了很多答案,但找到了解决方案。代码是

    UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
    UIViewController *viewController = nil;
    viewController = [storyBoard instantiateViewControllerWithIdentifier:@"First"];
    // lets add it to container view
    [viewController willMoveToParentViewController:self];
    [self.containerViewController addSubview:viewController.view];
    [self addChildViewController:viewController];
    [viewController didMoveToParentViewController:self];

0 个答案:

没有答案