iOS---tableView的代理
2015-10-14 15:24
537 查看
//指定这组与上一组的间距
可以自定义多个cell的间距
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
if(section ==0)
return 1;
if(section ==1)
return 1;
if(section ==3)
return 0;
else return
1;
}
//指定这组与下一组的间距
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
if(section ==0)
return 100;
if(section ==1)
return 200;
if(section ==3)
return 300;
else return
1;
}
//每行高度
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath
*)indexPath{
//如果是第0组,第0行
if(indexPath.section==0 &&indexPath.row==0)
return 120;
else return
44;
}
可以自定义多个cell的间距
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
if(section ==0)
return 1;
if(section ==1)
return 1;
if(section ==3)
return 0;
else return
1;
}
//指定这组与下一组的间距
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
if(section ==0)
return 100;
if(section ==1)
return 200;
if(section ==3)
return 300;
else return
1;
}
//每行高度
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath
*)indexPath{
//如果是第0组,第0行
if(indexPath.section==0 &&indexPath.row==0)
return 120;
else return
44;
}
相关文章推荐
- iOS后台如何保持socket长连接和数据传输
- IOS中Bitcode的
- iOS8下的远程推送
- iOS_XCode升级插件失效解决方法
- IOS第三方库 MARK
- IOS开发中(null)与<null>的处理
- IOS 开发中常用方法
- IOS SDK NSSetUncaughtExceptionHandler异常处理
- iOS类别(Category)
- SDWebImage浅析
- iOS 元件组件-创建静态库static library
- iOS --popToViewController -- 跳转界面
- iOS的影片播放 MediaPlayer 和 AVPlayer
- iOS --小知识点
- IOS-13-XML解析代码(标准版)_另附XML和JSON均解析为字典数据源代码
- iOS---生成四位验证码
- NSThread简介
- iOS --一个倒计时类
- GCD简介
- iOS中使用NSJSONSerialization转换成json字符串后传递到后台的引号转义处理