我这样设置 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 没有足够向下滚动所切断。但如果是这种情况,您必须更改 UITableViews (UIScrollView) contentsize。
CGSize wholesize = self.tableView.contentSize;
wholesize.height = self.tableView.contentSize.height + self.tableView.tableFooterView.frame.size.height;
self.tableView.contentSize = wholesize;
希望对您有所帮助。
关于ios - tableFooterView 属性中的 UIView 不适合 UITabelView 的 ScrollView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12050054/