Ios tableFooterView属性中的UIView不';t安装在UITableView和#x27内;滚动视图

Ios tableFooterView属性中的UIView不';t安装在UITableView和#x27内;滚动视图,ios,uitableview,Ios,Uitableview,我将tableView的tableFooterView设置为: UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 44)]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setFrame:CGRectMake(10, 10, footerView.bounds.size.width - 20, 44)]

我将tableView的tableFooterView设置为:

UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 44)];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setFrame:CGRectMake(10, 10, footerView.bounds.size.width - 20, 44)];
[button setBackgroundImage:[UIImage imageNamed:@"addItemButton.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(add) forControlEvents:UIControlEventTouchUpInside];
[footerView addSubview:button];
self.tableView.tableFooterView = footerView;
但是,当我滚动到tableview的最底部时,我的按钮被切断


如何确保显示整个按钮

问题并没有说明按钮是否被scrollview的向下滚动不够所切断。但如果是这种情况,您必须更改UITableView(UIScrollView)内容大小

CGSize wholesize =  self.tableView.contentSize;

wholesize.height = self.tableView.contentSize.height + self.tableView.tableFooterView.frame.size.height;

self.tableView.contentSize = wholesize;

希望这能有所帮助。

我希望我能给这10万张选票。好几个小时来我一直在想这个。