English 中文(简体)
如何更改第一个标签栏项的动作( 当单击时)
原标题:How to change the action of the first tabbaritem (when clicked)

I m trying to show a tableviewcontroller as the first page, with the tabbarcontroller in it. After it is shown I would like to change the action of the first item in the tabbarcontroller to show a menu.

我已经创建了菜单, 我只需要找到一个方法来改变制表栏控制器上第一个项目的点击事件 。

我已经找了好几个小时了 帮帮忙会感激不尽!

Thanks in advance, Tommy

我找到解决办法了,我明天就公布!

最佳回答

我找到一个好办法 解决这个问题...

我使用UITabBar主计长的代表,

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

我很高兴我终于找到解决办法!

问题回答

执行 实施

- (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]; } }





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签