模态试图(presentViewController)显示UINavigationBar


    在模态试图里,是不会被父试图劫持的,所以在打开模态试图的时候NavigationBar 是一个nil值.

    如果要在模态试图里显示UINavigationBar的话,我们得这么做:

  

    WritenViewController *writenView = [[WritenViewControlleralloc] init];

    UINavigationController *presNavigation = [[UINavigationControlleralloc] initWithRootViewController: writenView]; //创建一个NavigationController

    [selfpresentViewController: presNavigation animated: YEScompletion:^{

        NSLog(@"");

    }];

    [writenView release];

    [presNavigation release];

   这样在WritenViewController里NavigationBar就可以正常显示了.

同理Toolbar也是一样的.

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM