美文网首页
ios 隐藏顶部导航栏,tabbar,修改背景图

ios 隐藏顶部导航栏,tabbar,修改背景图

作者: 旅途开发者 | 来源:发表于2016-12-12 11:20 被阅读381次

    隐藏顶部导航栏

    -(void)viewWillAppear:(BOOL)animated {

    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:YES animated:YES];

    }

    -(void)viewWillDisappear:(BOOL)animated {

    [super viewWillDisappear:animated];

    [self.navigationController setNavigationBarHidden:NO animated:YES];

    }

    设置背景图

    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"001"]];

    进入界面时隐藏底部tabbar

    // 进入某个界面

    NextViewController *nextVC = [[TypeSupplierViewController alloc] init];

    // 根据点击种类不同,设立种类属性

    nextVC.hidesBottomBarWhenPushed=YES;

    // 进入后隐藏tabbar

    [self.navigationController pushViewController:nextVC animated:YES];

    // 退出时显示tabbar

    self.hidesBottomBarWhenPushed = NO;

    平常隐藏

    self.tabBarController.tabBar.hidden = YES;

    相关文章

      网友评论

          本文标题:ios 隐藏顶部导航栏,tabbar,修改背景图

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