Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want to remove header and footer from my 'UITableView' I have tried:

table.tableHeaderView = nil;

- (UIView *)tableView:(UITableView *)tableView 
            viewForHeaderInSection:(NSInteger)section{
   return nil;
}

- (CGFloat)tableView:(UITableView *)tableView 
           heightForHeaderInSection:(NSInteger)section{     
    return 0;
}

But none of this working. enter image description here

I want to start my section from starting of tableview.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
307 views
Welcome To Ask or Share your Answers For Others

1 Answer

When I try to do this, what usually ends up working is:

- (UIView *)tableView:(UITableView *)tableView 
            viewForHeaderInSection:(NSInteger)section{
    return [[UIView alloc] initWithFrame:CGRectZero];
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...