自定义tablecell

UIButton *btnPoi = [[UIButton alloc] initWithFrame:CGRectMake(0, 20, 30, 44)];

[btnPoi setBackgroundImage:[UIImage imageNamed:@"poi.png"] forState:UIControlStateNormal];

             [cell.contentView addSubview:btnPoi];

UILabel* lb=[[UILabel alloc] initWithFrame:CGRectMake(30, 20, 50, 44)];

lb.numberOfLines=0;

lb.text=@"位置:";

lb.tag=1;

lb.backgroundColor=[UIColor clearColor];

lb.font=[UIFont fontWithName:@"Helvetica-Bold" size:16];

[cell.contentView addSubview:lb];

UILabel* lbl=[[UILabel alloc] initWithFrame:CGRectMake(80, 0, 220, 100)];

lbl.numberOfLines=0;

lbl.text=[listData objectAtIndex:indexPath.section];

lbl.tag=1;

lbl.backgroundColor=[UIColor clearColor];

lbl.font=[UIFont fontWithName:@"Helvetica-Bold" size:16];

[cell.contentView addSubview:lbl];

你可能感兴趣的:(table)