sectionheadView 跟随UItabview滚动 去掉UItableview headerview黏性
2016-04-07 11:16
477 查看
//去掉UItableview headerview黏性
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView == self.myTableView)
{
CGFloat sectionHeaderHeight = YOUR_HEIGHT;
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
} else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView == self.myTableView)
{
CGFloat sectionHeaderHeight = YOUR_HEIGHT;
if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
} else if (scrollView.contentOffset.y>=sectionHeaderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}
}
相关文章推荐
- iOS之UITextField切换焦点
- jd-gui安装
- Android初学习 - android:sharedUserId="android.uid.system" 应用程序获得系统权限
- UITableView 基本使用方法总结
- Cadence中Quickview中没有预览
- NGUI实现滑动翻页效果实例代码
- JMS使用ActiveMQ实现Queue和Topic两种模式
- SUID浅析
- UIWindow输入密码
- 52. N-Queens II
- [IOS]为UILabel添加点击事件
- scrollview和UItableviewController结合使用时 要求穿透 NavigationBar和TabBar的技巧
- 建造者模式Builder Pattern
- GNUI30天从入门到吐血
- Buiding in Sandbox--2016微软预科生技术岗笔试题四--Java
- Qt Quick 简介
- 3.8.2 smtpd_chat_query和smtpd_chat_replay:与smtp客户端交互
- [na][tools]快速ping网段工具-QuickPing
- [转]MyBatis传入多个参数的问题 - mingyue1818
- [转]MyBatis传入多个参数的问题 - mingyue1818