-1

有没有办法在 xCode 上以编程方式重新排序 TabBar 的选项卡?

非常感谢,马特奥!

4

1 回答 1

1

尝试这个:

- (void)applicationDidFinishLaunching:(UIApplication *)application {

   tabBarController = [[UITabBarController alloc] init];

   MyViewController* vc1 = [[MyViewController alloc] init];
   MyOtherViewController* vc2 = [[MyOtherViewController alloc] init];

   NSArray* controllers = [NSArray arrayWithObjects:vc1, vc2, nil];
   tabBarController.viewControllers = controllers;

  // Add the tab bar controller's current view as a subview of the window
  [window addSubview:tabBarController.view];
 }
于 2013-03-15T17:59:30.760 回答