在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; }
<喎?/kf/ware/vc/" target="_blank" class="keylink">vcD4KPHA+tMu0pta70OjSqtTav8nK07uvytPNvNbQ0N64xEK1xNK7uPbK9NDUvLS/yaOov8nPp7rctuC8vMr1zsTVwra8w7vM4bW91eK146OsysfS8s6qztLDu9PQ1dK1vcLwo6mjrMjnz8LNvKOs0aHW0ELK0828o6yyorm00aFIaWRlIEJvdHRvbSBCYXIgb24gUHVzaDs8L3A+CjxwPjxpbWcgc3JjPQ=="/uploadfile/Collfiles/20141107/20141107083934136.png" alt="">