我在委託類中使用了一個UINavigation
控制器。在瀏覽第三個視圖類的兩個視圖類後,我需要一個tabbar
控制器,它可以控制另外三個ViewControllers
,並且不應在前兩個視圖控制器上看到Tabbar。我怎樣才能做到這一點 ?我可以在視圖控制器而不是委託類中使用tabbar控制器嗎?
- (void)viewDidLoad
{
[super viewDidLoad];
self.title [email protected]"Scan";
tabController =[[UITabBarController alloc]init];
ScanTicketView *scan =[[ScanTicketView alloc]initWithNibName:@"ScanTicketView" bundle:nil];
SearchView *search =[[SearchView alloc]initWithNibName:@"SearchView" bundle:nil];
HistoryView *history =[[HistoryView alloc]initWithNibName:@"HistoryView" bundle:nil];
tabController.viewControllers=[NSArray arrayWithObjects:scan,search,history, nil];
[self presentModalViewController:tabController animated:YES];
}
上面是我用來做到這一點的代碼。 –