0

tabbarcontroller を含む tableviewcontroller を最初のページとして表示しようとしています。それが表示された後、タブバーコントローラーの最初のアイテムのアクションを変更してメニューを表示したいと思います。

メニューを作成しました。tabbarcontroller の最初の項目のクリック イベントを変更する方法を見つけるだけです。

私は今何時間も探していましたが、助けていただければ幸いです!

前もってありがとう、トミー

*編集:解決策を見つけました。明日投稿します。

4

2 に答える 2

0

I found out a good way to handle this problem...

I used the UITabBarController delegate and implemented this:

 - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
  if([viewController.title isEqualToString:@"YourTitleHere"])
  {
     // do your stuff here
  }else
  {
     return YES;
  }
}

this Worked great for me, very happy that I finally found a solution! Hope this helps others as well!

于 2012-05-23T23:36:02.073 に答える
0

埋め込む

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{ if(tabBar.selectedItem.tag == 0) { RootViewController *objRootViewController = [[RootViewController alloc]init]; [self.navigationController pushViewController:objRootViewController animated:YES]; [objRootViewController release]; } }

于 2012-05-23T04:51:26.477 に答える