我有一个UIContainerVIew。从这里,我想在所有viewController中加载一个具有不透明度的UIView。
float width = [[UIScreen mainScreen] bounds].size.width;
float height = [[UIScreen mainScreen] bounds].size.height;
self.myView = [[ITSMyView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, width, height)];
[self.myView setFrame:CGRectMake(self.view.superview.superview.frame.origin.x, self.view.superview.superview.frame.origin.y, width, height)];
[self.view addSubview:self.myView];
如何正确添加并在UIContainerView的所有视图中显示?谢谢!
答案 0 :(得分:0)
你可以使用
for (UIViewController * vc in self.parent.childViewControllers) {
vc.view.addSubView(viewtoAdd)
}