2013-06-20 13 views
0

是否有任何可能的方式在當前視圖的子視圖中顯示另一個視圖並在相同頁面上訪問其控件和當前視圖控件。我的目標是將屏幕分爲上半部分屏幕變化的上半部分和下半部分(滾動上的不同視圖),下半部分是當前視圖的常量?一次顯示和控制2個視圖

+0

是的,你可以... – IronManGill

+0

請你分享一個鏈接,或做一些解釋給我啓發! –

回答

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]; 

看是否能幫助:)。

+0

謝謝你的快速回復,我會檢查它.. :) –

+0

工作正常嗎?這就像添加一個屬於它的控制器的視圖,並且它想要顯示在你的視圖中.haha :) –

+0

非常感謝,工作正常。不能投票給我沒有聲譽! –

相關問題