Reputation: 917
I want my footer appear with bottom, in the following image footer binding with grid, i want footer need to fixed at bottom, If tableview rows are more or less.
-(UITableViewCell *) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
static NSString *CellIdentifier = @"SectionHeader";
//UITableViewCell *headerView = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f,0.0f,300,60)] ;
UIImage *myImage=[UIImage imageNamed:@"top_bar.png"];
UIImageView *imageView =[[UIImageView alloc] initWithImage:myImage];
imageView.frame= CGRectMake(0, 0, 400, 50);
[headerView addSubview:imageView];
UIButton *circularButton = [UIButton buttonWithType:UIButtonTypeCustom];
CGRect circularRect = CGRectMake(5.0, 5, 58.0, 32.0);
[circularButton setFrame:circularRect];
[circularButton addTarget:self action:@selector(Meetup:) forControlEvents:UIControlEventTouchUpInside];
UIImage *buttonImage = [UIImage imageNamed:@"back_btn.png"];
[circularButton setImage:buttonImage forState:UIControlStateNormal];
[headerView addSubview:circularButton];
return headerView;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 50;
}
I am using above code. please advised me, thanks
Upvotes: 0
Views: 415
Reputation: 620
If I understood correctly what you need to do, which is to always keep the footer view docked to the bottom of the screen, my advice is to take that footer view out of the tableView and place it below your tableView in its parent view.
Upvotes: 1