其他屏幕中不同标签栏的解决方案

时间:2010-06-05 09:50:20

标签: iphone objective-c uitabbarcontroller

我正在为我的申请找到解决方案。 我创建了一个iphone应用程序有3个屏幕: 第一个屏幕不包含任何标签栏。第二个屏幕有2个标签栏项目。第三个屏幕有3个标签栏项目。 http://c.upanh.com/upload/7/719/L50.11932623_1_1.jpg

  • 如果我创建一个UITabBarController - >标签栏将从第一个屏幕出现。所以我必须在第一个屏幕中隐藏标签栏。但第二和第三屏幕有不同的标签栏 - >不太好主意。

你有解决这个问题的方法,请帮助我。

谢谢!!!

1 个答案:

答案 0 :(得分:0)

我认为您可以在运行时添加和删除UITabBarController中的选项卡。此网站适合阅读:UITabBarController

从标签栏中删除标签的一些示例代码:

- (IBAction)processUserInformation:(id)sender

{

   // Call some app-specific method to validate the user data.

   // If the custom method returns YES, remove the tab.

   if ([self userDataIsValid])

   {

      NSMutableArray* newArray = [NSMutableArray arrayWithArray:self.tabBarController.viewControllers];

      [newArray removeObject:self];



      [self.tabBarController setViewControllers:newArray animated:YES];

   }

}
相关问题