我想要像查看图像一样的东西,我想在标签栏应用程序或主故事板中执行此操作。这是我用标签栏项目做了普通的基于单一视图的应用程序。
我也尝试以下代码,当我单击标签栏项目时,特定的视图控制器会打开。但我想点击第三个标签栏项目,它应该显示 UIActionSheet 而不是第三个视图控制器。我怎么能做到这一点。
FisrtTabViewController *first = [[FisrtTabViewController alloc]initWithNibName:@"FisrtTabViewController" bundle:nil];
[first.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"myarea_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"myarea.png"]];
UINavigationController *tabItem1 = [[UINavigationController alloc] initWithRootViewController: first];
SecconTabViewController *second = [[SecconTabViewController alloc] initWithNibName:@"SecconTabViewController" bundle:nil];
[ second.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"areaconv_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"areaconv.png"]];
ThirdTabViewController *third = [[ThirdTabViewController alloc] initWithNibName:@"ThirdTabViewController" bundle:nil];
[ third.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"share_selected.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"share.png"]];
tabbar1.viewControllers = [NSArray arrayWithObjects:tabItem1,second,third,nil];
[[UITabBar appearance]setBackgroundImage:[UIImage imageNamed:@"tabbar.png"]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"tabbar_selected.png"]];
tabbar1.modalTransitionStyle =UIModalTransitionStyleCrossDissolve;
[self presentViewController:tabbar1 animated:YES completion:NULL];
提前致谢。