iOS开发精选Obj-CiOS Developer

iOS 10.1系统以前tableFooterView或tabl

2017-04-13  本文已影响77人  韦德460
看一下代码
 [self.footView addSubview:self.earnBonusView];
 [self.footView addSubview:self.confirmOrderFooterView];
 self.tableView.tableFooterView = self.footView;

CGFloat bonusViewHeight = (CGFloat)[self.confirmOrderFooterView getBonusViewHeight];
CGFloat earnBonusViewHeight = [self.earnBonusView earnBonusViewHeight:isShowEarnBonus];
CGFloat confirmFootViewHeight = TableFooterViewHeight - 16 + bonusViewHeight;
self.footView.height = earnBonusViewHeight + confirmFootViewHeight;
if (earnBonusViewHeight == 0) {
    self.confirmOrderFooterView.frame = CGRectMake(0, 0, kScreenWidth, confirmFootViewHeight);
} else {
    self.earnBonusView.frame = CGRectMake(0, 0, kScreenWidth, earnBonusViewHeight);
    self.confirmOrderFooterView.frame = CGRectMake(0, self.earnBonusView.bottom, kScreenWidth, confirmFootViewHeight);
}
问题:

self.footView.height高度变了,在10.1系统上面对应的tableview contentOffSize会对应改变,但是在10.1系统以前不变,这就造成如果高度变大,tableview无法滑动到低

解决办法:修改高度后加上两行代码
self.tableView.tableFooterView = nil;
self.tableView.tableFooterView = self.footView;


强烈推荐:超简单!!! iOS设置状态栏、导航栏按钮、标题、颜色、透明度,偏移等

https://github.com/wangrui460/WRNavigationBar
https://github.com/wangrui460/WRNavigationBar_swift



欢迎关注我的微博:wangrui460

上一篇下一篇

猜你喜欢

热点阅读