如果去掉UITableView上的section的headerView和footerView的悬浮效果
生活随笔
收集整理的這篇文章主要介紹了
如果去掉UITableView上的section的headerView和footerView的悬浮效果
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
項目需要cell的間距,又不需要懸浮效果,百度之后找到這個方法,記錄一下,備忘。
用UIScrollView的代理方法實現
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {CGFloat sectionHeaderHeight = 10; //這里是我的headerView和footerView的高度if (_tableView.contentOffset.y<=sectionHeaderHeight&&_tableView.contentOffset.y>=0) {_tableView.contentInset = UIEdgeInsetsMake(-_tableView.contentOffset.y, 0, 0, 0);} else if (_tableView.contentOffset.y>=sectionHeaderHeight) {_tableView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);} }
轉載于:https://www.cnblogs.com/wanghang/p/6298885.html
總結
以上是生活随笔為你收集整理的如果去掉UITableView上的section的headerView和footerView的悬浮效果的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CF 287(div 2) B Amr
- 下一篇: cat/tac/more/less 命令