zoukankan      html  css  js  c++  java
  • 创建纯洁的TableViewCell

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

    {

        //    声明静态字符串型对象,用来标记重用单元格

        static NSString *str = @"TableSampleIdentifier";

        //    用TableSampleIdentifier表示需要重用的单元

        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:str];

        //    如果如果没有多余单元,则需要创建新的单元

        if (!cell) {

            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:str];

        }

        //    填充行的详细内容

        cell.detailTextLabel.text = @"详细内容";

        

        //    表视图单元提供的UILabel属性,设置字体大小

        cell.textLabel.font = [UIFont boldSystemFontOfSize:40.0f];

        //    设置单元格UILabel属性背景颜色

        cell.textLabel.backgroundColor=[UIColor clearColor];

        return cell;

    }

  • 相关阅读:
    [ASP.NET Core] Tips
    Integration_Unit test coding standard
    集成测试报错的解决方案
    Integration testing
    Web Cache
    BIT
    CSU 1449: A+B and C
    [转] CUDA + code::blocks 配置
    CF 245 div2
    NBUT 2014 C Lord of Minecraft
  • 原文地址:https://www.cnblogs.com/yyj900165/p/4856708.html
Copyright © 2011-2022 走看看