2013-05-31 53 views
1

我正在使用在屏幕底部具有自定義菜單的應用程序(如Tabbar).Custom菜單將全部顯示在UIViewController中。在iOS 5中使用addbarViewbarControl在菜單欄底部實現MenBar

例如:我在底部有6個菜單按鈕。當我點擊Button1時,我可以在自定義菜單的上方看到UIViewController1UIViewController1UITableView和列表將被顯示。當我點擊didSelectRowAtIndexPathUIViewController2將打開導航。

如何使用addChildViewController實現此目的。 ?

我已經參考this link,但沒有得到與我不同UIViewController成功與推。

回答

0
It is very simple u can do it in multiple ways one way is to add navigation controller to root view controller and then push all the views one by one according to requirement. 

Your you can addview also like this 

SecondView * myModalVC = [[SecondView alloc] init]; 
/* 
    [myModalVC setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal]; 
    [self presentViewController:myModalVC animated:YES completion:NULL]; 

*/ 

/* 
[UIView transitionWithView:self.view duration:3.0 options:UIViewAnimationOptionTransitionCurlUp animations:^{[self.view addSubview:myModalVC.view];} completion:NULL]; 


    */ 
    CATransition *transition = [CATransition animation]; 
    transition.duration = 1.25; 
    transition.type = kCATransitionPush; 
    transition.subtype = kCATransitionFromRight; //choose your animation 
    [transition setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]]; 

    [myModalVC.view.layer addAnimation:transition forKey:nil]; 


     [self presentViewController:myModalVC animated:NO completion:NULL]; 

    // [self transitionFromViewController:self toViewController:myModalVC duration:2.0 options:UIViewAnimationOptionTransitionNone animations:<#^(void)animations#> completion:<#^(BOOL finished)completion#>] 

其以往ü喜歡U可以簡單使用:)