UITableview Group 与plain 样式区别
来源:互联网 发布:无线点菜系统源码 编辑:程序博客网 时间:2024/06/06 09:03
一、UITableViewStylePlain
1.有多段时 段头停留(自带效果)
2.没有中间的间距和头部间距(要想有的重写UITableViewCell \UITableViewHeaderFooterView里面的setFrame方法)
扩展:让段头不停留(取消粘性效果)
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = 30;
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);
}
}
二、UITableViewStyleGroup
注意:去掉头部和中间间隔
正确的理解方法
1.设置标头的高度为特小值 (不能为零 为零的话苹果会取默认值就无法消除头部间距了)
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 0.001)];
view.backgroundColor = [UIColor redColor];
self.tableView.tableHeaderView = view;
2.写代理方法(中间的留白其实是段尾的高度 代理的作用设置段尾的高度 返回值也不能为0)
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0.01f;
}
特殊的处理方法也能实现该效果
1. self.tableView.contentInset = UIEdgeInsetsMake(-44, 0, 0, 0);
2.重写UITableViewHeaderFooterView的
-(void)setFrame:(CGRect)frame{
frame.size.height+=10;
[super setFrame:frame];
}
- UITableview Group 与plain 样式区别
- tableView plain样式和group样式区别
- tableview的plain与group区别
- UITableView的Group样式的详细使用
- iOS开发之UITableView的两种类型(plain和group)
- UITableView Group 样式下边框宽度并禁止滚动视图
- UITableViewStyle设置Group、Plain问题
- text/html与text/plain有什么区别?
- text/plain 与 text/xml有什么区别
- text/html与text/plain有什么区别?
- UITableView分割线样式与颜色
- UITableView样式
- uitableview group的一些问题 (设置两个section之间的距离,设置背景颜色 等)在plain下去掉foot view的粘性
- group 与 groups的区别
- UITableview Plain风格下 SectionHeader悬浮问题
- IOS-UITableViewStyle设置Group、Plain问题
- IOS-UITableViewStyle设置Group、Plain问题
- 去掉UITableView中Group样式cell的边框目前最完美方法
- MyBatis
- 获取短信验证码
- 新生活开始了
- 【OpenCV入门指南】第十三篇 人脸检测
- imx6q中led驱动分析
- UITableview Group 与plain 样式区别
- java通过JDBC链接SQLSERVER2012
- 机器学习实践之手写数字识别 - 数据初识
- 关于安卓错误android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
- 嵌入式C语言位运算之清位置位
- 怎么把图片转换成pdf格式
- Jimoshi_Hibernate 框架学习(四)--事务隔离级别、Hibernate执行SQL、HQL语句、连接池、Hibernate二级缓存
- Linux下perl文件的执行
- Web自动化框架LazyUI使用手册(1)--框架简介