簡體   English   中英

iOS7 tableView頁腳高度

[英]iOS7 tableView footer height

我目前正在嘗試學習一些iOS應用開發,並且遇到了目前無法修復的問題。

我曾嘗試環顧四周,並被告知可以解決問題,但這似乎並沒有幫助我。

view.frame = CGRectMake(80.0, 210.0, 160.0, 140.0);

無論如何,這是完整的代碼:

- (UIButton *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIButton *view = [UIButton buttonWithType:UIButtonTypeRoundedRect];;
if (section == [tableView numberOfSections] - 1) {
    // This UIView will only be created for the last section of your UITableView
    [view setBackgroundColor:[UIColor colorWithRed:(236/255.0) green:(127/255.0) blue:(55/255.0) alpha:1]];
    view.titleLabel.font = [UIFont systemFontOfSize: 15 ];
    [view setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [view addTarget:self
               action:@selector(aMethod:)
     forControlEvents:UIControlEventTouchUpInside];
    [view setTitle:@"LOGIND" forState:UIControlStateNormal];
    view.frame = CGRectMake(80.0, 210.0, 160.0, 140.0);

}
return view;

}

需要有關此處可能出問題的指導。 提前致謝。

使用以下方法在部分中傳遞頁腳的高度

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
  return 140.0;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM