[英]How to Set UITabBarController to not select any Tab (ViewController) when TabBarController comes to View
我已經面對這個問題
我需要從帶有兩個選項卡的導航控制器 (tableView DidSelectRow .....)中打開一個TabBarController ,因為當TabBarController變為活動狀態時,它會選擇一個選項卡,是否隱式地像
[_tabBarController setSelectedIndex:0]
但是要在TabBarController變為活動狀態時選擇任何選項卡,而是視圖包含底部帶有選項卡的背景圖像。 該選項卡只有在選項卡中時才被選中和激活。
有辦法做到嗎?
如果沒有選擇任何選項卡欄項,則使您想要顯示的UIViewController。 品牌:
MyNoSelectedViewController *myViewController = [[MyNoSelectedViewController alloc] initWithNibName:@"MyNoSelectedViewController" bundle:[NSBundle mainBundle]];
[self.tabBarController setSelectedViewController:nil];
[self.tabBarController setSelectedViewController:myViewController];
希望能幫助到你。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.