您的位置:首页 > 产品设计 > UI/UE

ios uitableviewcell

2016-04-02 09:18 363 查看
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *identifier =
@"ChongZhiViewCell";

    ChongZhiViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:identifier];

    if (cell == nil) {

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

    }

    if (indexPath.row ==
0) {

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

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

        [self.view
addSubview:self.imgV];

        

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

        self.titleLB.backgroundColor = [UIColor
whiteColor];

        self.titleLB.font = [UIFont
systemFontOfSize:15];

        self.titleLB.text =
_titleString;

        [self.view
addSubview:self.titleLB];

    }

    if (indexPath.row ==
1) {

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

    }if (indexPath.row ==
2) {

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

    }

   

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

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

        [button.layer
setCornerRadius:10.0];

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

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

        [self.view
addSubview:button];

    

    return cell;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: