首页 > 移动平台 > 详细

IOS开发复习笔记(4)-TableView

时间:2014-07-28 11:22:30      阅读:284      评论:0      收藏:0      [点我收藏+]

总结几个TableView常用的代码

初始化方面

static string CellIndetifier="cellIndetifier";
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
     return 1;//表中段数
}
-(NSInterger)tableView:(UITableVIew *)tableView numberOfRowsInSection:(NSInteger)section{
    retrun 0;//每个段中的单元格数量
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc]
                initWithStyle:UITableViewCellStyleDefault
                reuseIdentifier:cellIdentifier];
    }
    // Configure the cell.
    return cell;
} //配置单元格

IOS开发复习笔记(4)-TableView,布布扣,bubuko.com

IOS开发复习笔记(4)-TableView

原文:http://www.cnblogs.com/keithmoring/p/3872159.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!