ios uitableviewcell

来源:互联网 发布:曹琴默 知乎 编辑:程序博客网 时间:2024/05/20 00:52

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

    static NSString *identifier =@"ChongZhiViewCell";

    ChongZhiViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];

    if (cell == nil) {

        cell = [[ChongZhiViewCellalloc] initWithStyle:(UITableViewCellStyleSubtitle)reuseIdentifier:identifier];

    }

    if (indexPath.row ==0) {

        self.imgV = [[UIImageViewalloc] initWithFrame:CGRectMake(8,8, 40, 40)];

        self.imgV.backgroundColor = [UIColormyColorWithString:@"1E90FF"];

        [self.viewaddSubview:self.imgV];

        

        self.titleLB = [[UILabelalloc] initWithFrame:CGRectMake(60,12, 300, 40)];

        self.titleLB.backgroundColor = [UIColorwhiteColor];

        self.titleLB.font = [UIFontsystemFontOfSize:15];

        self.titleLB.text =_titleString;

        [self.viewaddSubview:self.titleLB];

    }

    if (indexPath.row ==1) {

      cell.titleLB.text =@"缴费:";

    }if (indexPath.row ==2) {

        cell.titleLB.text =@"户号:";

    }

   

        UIButton *button = [UIButtonbuttonWithType:(UIButtonTypeCustom)];

        button.frame = CGRectMake(40, 300, 300, 40);

        [button.layer setCornerRadius:10.0];

        button.backgroundColor = [UIColormyColorWithString:@"1E90FF"];

        [button setTitle:@"确定"forState:(UIControlStateNormal)];

        [self.viewaddSubview:button];

    

    return cell;

}


0 0
原创粉丝点击