我目前正在尝试学习一些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;
}
需要指导什么可能会出错。
使用以下方法传递section
页脚的高度-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 140.0;
}