1、使用pushViewController
如A->B;A是列表页,带有tabbar;B是内容页,不需要tabbar;
在A的事件中打开B,如下代码
-(void)showVideo:(EJAlbumModel *)model bySId:(NSString *)sid{
NSLog(@"%@",@"执行委托");
EJClassVideoViewController *videoController=[[EJClassVideoViewController alloc] init];
videoController.model=model;
videoController.semesterClassId=sid;
self.navigationItem.backBarButtonItem=[[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleBordered target:nil action:nil];// 修改下级页面的返回按钮,此处我是很想写到videoController中,但是backBarButtonItem的机制决定必须写在A中;
[self.navigationController pushViewController:videoController animated:YES];
}
在B的加载View视图事件initWithNibName中,加入 self.hidesBottomBarWhenPushed=YES;即可实现打开B隐藏tabbar,返回A重新现实tabbar;很简单吧
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.hidesBottomBarWhenPushed=YES;
}
return self;
}