首页 > 代码库 > status bar、navigationBar、tableView吸顶view设置

status bar、navigationBar、tableView吸顶view设置

1. 隐藏navigationBar

self.navigationController.navigationBar.hidden = YES;

2. status bar设置

-(void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
 
     [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
}

-(void)viewDidDisappear:(BOOL)animated{
    [super viewDidDisappear:animated];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}

3. tableView吸顶设置一个topHoverView

[RACObserve(topHoverView, viewHeight) subscribeNext:^(NSNumber * viewHeight) {
                CGFloat height = [viewHeight floatValue];
                self.tableView.contentInset = UIEdgeInsetsMake(height, 0.0f, 0.0f, 0.0f); }];

 

status bar、navigationBar、tableView吸顶view设置