0

是否有任何可能的方法在当前视图的子视图中显示另一个视图并访问其控件和当前视图控件,两者都在同一页面上。我的目标是将屏幕分为上半部分和下半部分,上半部分屏幕发生变化(Scroll上的不同视图),下半部分是当前视图不变?

4

1 回答 1

2

让我猜猜上视图是由当前控制器控制的,而下视图是由子控制器控制的?如果是这样,你可以这样工作

 //in the current view controller named as currentVC, add the other viewController

 TheOtherViewContrller *controller = [....];

 controller.view.frame = CGRectMake(0,currentVC.size.height/2,currentVC.size.width/2,currentVC.size.height/2);

 //this is add a child view contrller to controll the other view controller!

 [currentVC addChildViewContrller:controller];
 [currentVC.view addSubview:controller.view];

看看这是否有帮助:)。

于 2013-06-20T10:07:32.557 回答