美文网首页
iOS使用push隐藏子页面底部bottom TabBar

iOS使用push隐藏子页面底部bottom TabBar

作者: wo一人两袖清风 | 来源:发表于2017-08-08 12:58 被阅读0次

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;

}

相关文章

网友评论

      本文标题:iOS使用push隐藏子页面底部bottom TabBar

      本文链接:https://www.haomeiwen.com/subject/hjjtrxtx.html