5

私はpresentModalViewControllerを使用してビューを表示します。このUIViewからUIViewUINavigationControllerでプッシュしたいと思います。 私はこのpush uiviewcontroller fromModalViewController

[self.parentViewController.navigationController 
       pushViewController:objViewFullScreen 
          animated:YES]; 

ためのコードの下にしようとしたが、それは私のために動作しませんでした。どのように私がModelViewControllerからビューをプッシュするかを提案することができます。あなたが行うことができますMyViewControllerの内側その後

MyViewController *vc = [[MyViewController alloc] initWithNibName:@"MyNib" bundle:nil]; 
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:vc]; 

[self presentModalViewController:nc animated:YES]; 

[vc release]; 
[nc release]; 

:あなたはナビゲーションコントローラ内部のあなたのモーダルビューコントローラを提示する必要が

おかげ

答えて

8

まず迅速な返信用

OtherViewController *vc = [[OtherViewController alloc] initWithNibName:@"MyOtherNib" bundle:nil]; 
[self.navigationController pushViewController:vc animated:YES]; 
[vc release]; 
+0

感謝。わたしにはできる。 vcビューは透過的ではありません。私も[彩色クリアカラー]を設定しますが、それは私のためには機能しません。どのように私はそれを透明にするかを私に示唆することができます。 Thx –

+0

http://stackoverflow.com/questions/849458/transparent-modal-view-on-navigation-controller/859215#859215 – pt2ph8

0
-(void)pushViewControllerWithCustomAnimation:(UIViewController *)newViewController { 
    newViewController.view.alpha = 0.0f; 
    [self.view addSubview:newViewController.view]; 

    [UIView animateWithDuration:1 
        animations:^{ 
         newViewController.view.alpha = 1; 
        } 
        completion:^(BOOL fin){ 
         if (fin) { 
          // finally display the new viewcontroller for real 
          [self.navigationController pushViewController:newViewController animated:NO]; 
         } 
        }]; 
}