1. 去除Plain的tableView下面多余的空的cell
self.tableView.tableFooterView = [[[UIView alloc] initWithFrame:CGRectZerocolor:[UIColor clearColor]] autorelease];
2. UITableViewFooter autoresizing无法正常生效
if (!_tableFooterView) { _tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.size.width, 80)]; _tableFooterView.backgroundColor = [UIColor clearColor]; _tableFooterView.autoresizingMask = UIViewAutoresizingFlexibleWidth; } if (!_confirmBuyButton) { _confirmBuyButton = [[UIButton alloc] initWithFrame:CGRectMake((self.tableView.size.width - 268)/2.0f, 10, 268, 51)]; [_confirmBuyButton setTitle:@"确认订单" forState:UIControlStateNormal]; _confirmBuyButton.autoresizingMask = c; UIImage *backImage = [TTIMAGE(@"bundle://detail_orange_button_bkg.png") tbResizableImageWithCapInsets:UIEdgeInsetsMake(0, 7, 0, 7)]; [_confirmBuyButton setBackgroundImage:backImage forState:UIControlStateNormal]; [_confirmBuyButton addTarget:selfaction:@selector(confirmButtonClicked:) forControlEvents:UIControlEventTouchUpInside]; } [_tableFooterViewaddSubview:_confirmBuyButton]; self.tableView.tableFooterView = _tableFooterView;
_confirmBuyButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
无法生效,button的位置不对,但是改为如下
_confirmBuyButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin
button的位置就正常了,可以正常居中了