tabBar隐藏方式

如果是从A push到B,并且把A的一个东西传到B,那么在push时就要隐藏tabBar,并且要在B ViewController设置一个接收A传到的属性。

这种方式一般用在表格点选,要把表格点选的内容传到B去。

A中的代码大概就是这样:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    

    Friends *f = self.allFriends[indexPath.row];

    

    chatViewController *chatVC = [[chatViewController alloc] initWithNibName:@"chatViewController" bundle:nil];

    

    chatVC.chatWithFriend = f;

    

    // Push the view controller.

    chatVC.hidesBottomBarWhenPushed = YES;

    [self.navigationController pushViewController:chatVC animated:YES];

}

 

而B中用一个属性接收到A传来的值进行处理即可。

原文地址:https://www.cnblogs.com/endtel/p/4729935.html