隱藏tabbar和navibar

隱藏tabbar和navibar
一、navigation
// 設(shè)置navigationBar的背景顏色,根據(jù)需要自己設(shè)置
self.navigationBar.barTintColor = UIColorFromRGB(0x0087ca);
// 設(shè)置navigationBar是否透明,不透明的話會使可用界面原點(diǎn)下移(0,0)點(diǎn)為導(dǎo)航欄左下角下方的那個點(diǎn)
self.navigationBar.translucent = NO;
// 設(shè)置navigationBar是不是使用系統(tǒng)默認(rèn)返回,默認(rèn)為YES
self.interactivePopGestureRecognizer.enabled = YES;
// 創(chuàng)建一個顏色,便于之后設(shè)置顏色使用
UIColor * color = [UIColor whiteColor];
// 設(shè)置navigationBar元素的背景顏色,不包括title
self.navigationBar.tintColor = color;
// 設(shè)置navigationController的title的字體顏色
// NSDictionary * dict=[NSDictionary dictionaryWithObject:color forKey:NSForegroundColorAttributeName];
//self.navigationBar.titleTextAttributes = dict;

二、tabbarController
1.-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self hidesTabBar:NO animated:YES];
}
-(void)viewWillDisappear:(BOOL)animated
{
[self hidesTabBar:YES animated:YES];
}
2.hidesBottomBarWhenPushed
**在push控制器前設(shè)置yes 在語句后設(shè)置No 這樣pop back時候就恢復(fù)顯示;

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

推薦閱讀更多精彩內(nèi)容