[英]How to enable two view controllers in the same window
我正在嘗試在我的應用程序中開發一個幻燈片菜單,該菜單應根據滑動方向從左側(或右側)打開菜單視圖。
到目前為止,我所做的是:
1-創建一個主View Controller A
2-創建左(或右)視圖控制器B
3-點擊“滑動”按鈕時,將B ViewController添加為A View Controller的子視圖。
4-這是我的代碼:
CGRect currentLeftFrame = self.leftVC.view.frame;
currentLeftFrame.origin = CGPointMake(-1.0f * self.view.frame.size.width, 0.0f);
self.leftVC.view.frame = currentLeftFrame;
[self addChildViewController:self.leftVC];
[self.view addSubview:self.leftVC.view];
[self.leftVC didMoveToParentViewController:self];
問題是B View控制器中的按鈕不可單擊。
有人知道如何解決這個問題嗎?
提前致謝。
將UIView用於幻燈片面板,並將幻燈片視圖添加為viewController的視圖或應用程序窗口上的子視圖。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.