单行文字cell的创建,可重复利用cell

来源:互联网 发布:seo怎么做优化 编辑:程序博客网 时间:2024/05/16 06:34

单行文字cell的创建,可重复利用cell

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

  

    //单行文字cell的创建,可重复利用cell

        UITableViewCell *cell  = [tableView dequeueReusableCellWithIdentifier:@"cell"];

        

        if (!cell) {

            cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];

        }

        cell.backgroundColor=[UIColor clearColor];

        cell.textLabel.text =self.cityArray[indexPath.section];

        cell.textLabel.textColor=[UIColor darkGrayColor];

        cell.textLabel.font=[UIFont systemFontOfSize:NormalFont];

        cell.selectionStyle=UITableViewCellSelectionStyleNone;

        

        return cell;

}


0 0
原创粉丝点击