1

我的应用程序是导航基础应用程序。在此应用程序中,UIViewController 具有按钮事件。点击按钮触发(pushViewController)CalendarTableview。现在我需要将 Tabbar 和 tabitem 添加到 calendartableview 。如何将 Tabbar 和 tabitem 添加到 CalendarTableview。帮我 。

这是我的照片。替代文字 谢谢。

4

2 回答 2

2

UINavigationController 有一个内置的导航工具栏。检查苹果开发者文档中的部分,如果我正确理解您的问题,这应该会有所帮助。 意见

于 2011-01-06T14:38:52.680 回答
1

在您的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]];
于 2011-01-06T14:30:15.120 回答