IOS UINavigationController 導航控制器

來源:互聯網
上載者:User

標籤:style   os   io   ar   cti   ad   ef   on   

/**

 導航控制器掌握:

 1.建立導航控制器

 UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:self.viewController];

 

 

 2.zhan (zhan 中所有的子控制器)

 self.navigationController.viewControllers;

 

 3.將控制器壓入zhan 中

     [self.navigationController pushViewController:second animated:YES];

 4.將控制器從zhan 中彈出

 1>將zhan 頂控制器彈了

 

 5.導覽列顯示的內容

 //彈回zhan頂

 //[self.navigationController popViewControllerAnimated:YES];

 //回到 底控制器(根控制器)

 //彈回zhan 底

 [self.navigationController popToRootViewControllerAnimated:YES];

 //回到哪 人控制器

 

 //[self.navigationController popToViewController:animated:YES];

 5.導覽列顯示的內容

 //zhan 頂控制器的navigationItem屬性

 

 self.navigationItem.title = @"你好世界";

 self.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:nil action:nil];

 

 //設定下一個介面的返回按鈕

 self.navigationItem.backBarButtonItem =[[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:nil action:nil];

 /zhan 頂控制器的navigationItem屬性決定了導覽列顯示的東西@

 //導覽列左邊的返回鍵,是由上一個鍵決定的

 

 //self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:nil action:nil];

 

 self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"設定" style:UIBarButtonItemStyleDone target:self action:@selector(clickSetting)];

 

 // Do any additional setup after loading the view from its nib.

 6.//zhan 頂控制器

 self.navigationController.topViewController;

 */

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.