美文网首页
隐藏tabbar和navibar

隐藏tabbar和navibar

作者: 七维树 | 来源:发表于2016-11-11 17:53 被阅读15次

隐藏tabbar和navibar
一、navigation
// 设置navigationBar的背景颜色,根据需要自己设置
self.navigationBar.barTintColor = UIColorFromRGB(0x0087ca);
// 设置navigationBar是否透明,不透明的话会使可用界面原点下移(0,0)点为导航栏左下角下方的那个点
self.navigationBar.translucent = NO;
// 设置navigationBar是不是使用系统默认返回,默认为YES
self.interactivePopGestureRecognizer.enabled = YES;
// 创建一个颜色,便于之后设置颜色使用
UIColor * color = [UIColor whiteColor];
// 设置navigationBar元素的背景颜色,不包括title
self.navigationBar.tintColor = color;
// 设置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控制器前设置yes 在语句后设置No 这样pop back时候就恢复显示;

相关文章

网友评论

      本文标题:隐藏tabbar和navibar

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