_tv = [[UITableView alloc]initWithFrame:self.bounds style:UITableViewStyleGrouped];
//让tableview下拉后底部没有空间
_tv.estimatedRowHeight = 0;
_tv.estimatedSectionFooterHeight = 0;
_tv.estimatedSectionHeaderHeight = 0;
_tv.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
_tv.delegate = self;
_tv.dataSource = self;
[self addSubview:_tv];
//重写方法
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
UIView* footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 60.0)];
UILabel *label = [[UILabel alloc] init];
label.frame = CGRectMake(20, 20, self.width- 40 , 20);
label.text = @"----没有更多记录了----";
label.textColor = [UIColor lightGrayColor];
label.font = [UIFont systemFontOfSize:15];
label.textAlignment = NSTextAlignmentCenter;
[footerView addSubview:label];
return footerView;
}
ios UITableView上拉底部设置提示语
最新推荐文章于 2024-07-22 12:20:03 发布