簡體   English   中英

如何將選項卡添加到uitableview

[英]how to add tabbar to uitableview

我的應用程序是基於導航的應用程序。在此應用程序中,UIViewController具有按鈕事件。 點擊按鈕觸發到(pushViewController)CalendarTableview。 現在,我需要將Tabbar和tabitem添加到calendartableview。 如何將Tabbar和tabitem添加到CalendarTableview。 幫我 。

這是我的照片。 替代文字 謝謝。

UINavigationController具有內置的導航工具欄。 查看appples開發人員文檔中的部分,如果我正確理解您的問題, 該部分將對您有所幫助。 意見

在您的calendartableview_controller的viewDidLoad()方法中,嘗試以編程方式創建一個標簽欄,然后將其作為子視圖添加到calendartableview_controller的視圖中:

   //create a tab bar controller in your calendartableview_controller
   UITabBarController *tabBarController = [[UITabBarController alloc] init];
   tabBarController.title = @"My Tab Bar";

   //assign child controllers to the tab bar controller
   tabBarController.viewControllers = [NSArray arrayWithObjects:firstViewController, secondViewController, thirdViewController, nil];

   //add it to your calendartableview_controller's view as a subview
   [self.view addSubview:[tabBarController view]];

暫無
暫無

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

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