在我的应用程序中,我想修复表格视图底部的按钮。
这是我的初始屏幕,
在页脚部分创建的按钮
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
if(tableView == educateTbl)
{
float footerWidth = 150.0f;
float padding = 10.0f;
UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, footerWidth, 50.0)];
footerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
UIButton *addEdu = [[UIButton alloc]initWithFrame:CGRectMake(padding, 0, footerWidth - 2.0f * padding, 44.0f)];
addEdu.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
addEdu.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
[addEdu setTitle:@"Add Education" forState:UIControlStateNormal];
[addEdu addTarget:self action:@selector(addEducation:) forControlEvents:UIControlEventTouchUpInside];
[addEdu setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
addEdu.frame=CGRectMake(0, 0, 200, 30);
[footerView addSubview:addEdu];
return footerView;
}
return nil;
}
之后我就变成这样了
我该如何解决?