UITableViewStyleGrouped的间距问题
2016-05-05 15:52
549 查看
[UITableView
alloc]initWithFrame:CGRectMake(。。。。)
style:UITableViewStyleGrouped];
UITableViewStyleGrouped,section的间距由footer和header组成,调整footer和header的大小就可以了。
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
if (section == 0) {
UIView *view = [[UIView
alloc]initWithFrame:CGRectMake(0, 0,
SCREEN_W, 100)];
//。。。。。。
return view;
}
return
nil;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return
nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return section == 0 ? 100 : 1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 1;
}
alloc]initWithFrame:CGRectMake(。。。。)
style:UITableViewStyleGrouped];
UITableViewStyleGrouped,section的间距由footer和header组成,调整footer和header的大小就可以了。
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
if (section == 0) {
UIView *view = [[UIView
alloc]initWithFrame:CGRectMake(0, 0,
SCREEN_W, 100)];
//。。。。。。
return view;
}
return
nil;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
return
nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return section == 0 ? 100 : 1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 1;
}
相关文章推荐
- 层和UIView的区别是什么?
- Electron实战:创建ELectron开发的window应用安装包
- C#中跨线程操作控件 --- InvokeRequired 属性 与Invoke方法
- .NoHostAvailableException: All host(s) tried for query failed (no host was tried)
- EasyUI学习总结(六)——EasyUI布局
- EasyUI学习总结(五)——EasyUI组件使用
- EasyUI学习总结(四)——parser源码分析
- EasyUI学习总结(三)——easyloader源码分析
- EasyUI学习总结(二)——easyloader分析与使用
- ios UITableview 刷新某一个cell 或 section
- EasyUI学习总结(一)——EasyUI入门
- UIButton 文字在左,icon在右的办法
- Assertion failure in -[UICollectionView layoutSublayersOfLayer:]
- hdu 1005 Number Sequence
- GUIStyle和GUISkin
- Easyui通用消息提示、提交表单、ajax请求
- iOS中UITextFiled只能输入数字和小数点
- Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timest
- unsolved 2 db2 issues
- web.xml is missing and <failOnMissingWebXml> is set to true