有时候,我们的Controler中包含有另一个controler view的view时,可以使用这种方式。
https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html
把一个controller view 加入到 controler中
[self addChildViewController:content]; //1 content.view.frame = [self frameForContentController]; [self.view addSubview:self.currentClientView]; //2 [content didMoveToParentViewController:self]; //3
移除一个controller view
[content willMoveToParentViewController:nil]; //1 [content.view removeFromSuperview]; //2 [content removeFromParentViewController]; //3
时间: 2024-10-07 11:31:41