簡體   English   中英

加載標簽欄項目的方法?

[英]Method to load a tab bar item?

我有2個標簽欄項。 第一個標簽內有一個導航控制器(3個視圖)。

假設我在導航控制器的第三個視圖上,如何加載第二個選項卡。

因此,您想從第一個選項卡切換到第二個選項卡。 好吧,首先您需要訪問tabbarController。 大多數時候,您會在AppDelegete中使用標簽欄控制器。 像這樣調用委托:

MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];

然后只需設置selectIndex:

[delegate.tabBarController setSelectedIndex:1];

要么

[delegate.tabBarController setSelectedViewController:self.secondViewController];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM