2013-04-29 76 views
0

我希望我的頁腳出現在底部,在下面的圖片頁腳綁定與網格,我希望頁腳需要固定在底部,如果tableview行更多或更少。viewForFooterInSection需要設置頁腳固定的絕對位置

enter image description here

-(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; 

} 

我使用上面的代碼。請勸我,謝謝

+0

您的問題/接受的答案比例很低。請不要自私,對於人們浪費在這裏幫助你並至少接受有效答案的時間表示感激。如果他們看到你自私,人們就不會再幫你了。 – 2017-11-12 20:32:23

回答

1

如果我理解正確的,你需要做什麼,這是始終保持停靠在屏幕底部的頁腳視圖,我的建議是採取頁腳視圖出來的 tableView和將它放在您的tableView下方的父視圖中。