美文网首页
怎么实现类似tableview的悬浮header动态改变值

怎么实现类似tableview的悬浮header动态改变值

作者: 这个姑凉儿 | 来源:发表于2022-06-16 16:39 被阅读0次
//    self.bb  = [[UILabel alloc]init];
//    self.bb.backgroundColor = [UIColor redColor];
//    [self.view addSubview:self.bb];
//    [self.bb mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.offset(70);
//        make.left.right.offset(0);
//        make.height.offset(40);
//    }];
}
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{

//    [self getNowTopSectionView];
}
//// 获取tableView最上面悬停的SectionHeaderView
//- (void)getNowTopSectionView {
//    NSArray <UITableViewCell *> *cellArray = [self.tableView visibleCells];
//    NSInteger nowSection = -1;
//    if (cellArray) {
//        UITableViewCell *cell = [cellArray firstObject];
//        NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
//        nowSection = indexPath.section;
//    }
//    NSLog(@"当前悬停的组头是:%ld",nowSection);
//    self.bb.text = [NSString stringWithFormat:@"当前是第%ld个分区",nowSection];
//}

相关文章

网友评论

      本文标题:怎么实现类似tableview的悬浮header动态改变值

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