【问题标题】:iOS7 tableView footer heightiOS 7 uitableView 页脚高度
【发布时间】:2014-07-01 07:02:43
【问题描述】:

我目前正在尝试学习一些 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;

}

需要有关此处可能出现问题的指导。提前致谢。

【问题讨论】:

    标签: ios iphone xcode ios7


    【解决方案1】:

    使用以下方法在节中为页脚传递高度

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

    【讨论】:

      猜你喜欢
      • 2012-04-24
      • 2014-05-26
      • 1970-01-01
      • 2014-01-31
      • 1970-01-01
      • 2018-07-15
      • 2014-09-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多