开发者

align data on the UITableViewCell?

I want to align data on the UITableViewCell

My tabl开发者_高级运维e displays image. after that price.... space............year.....space.........model.....space. In a single line. In tableviewcell.


Set the frame property for each subview in your custom cell.


cell.textLabel.text=[NSString stringWithFormat:@"year: %@         price: %@",[yearList objectAtIndex:indexPath.row],[priceList objectAtIndex:indexPath.row]];


cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
//  CGRect frame;
//  frame.origin.x=10;
//  frame.origin.y=5;
//  frame.size.height=20;
//  frame.size.width=100;
//  frame.origin.x+=90;
//  
//  priceLabel=[[UILabel alloc]initWithFrame:frame];
//  priceLabel.textColor = [UIColor orangeColor];
//  priceLabel.tag=PriceTag;
//  [cell.contentView addSubview:priceLabel];
//  [priceLabel release];

//  frame.origin.x+50;
//  yearLabel=[[UILabel alloc]initWithFrame:frame];
//  yearLabel.tag=YearTag;
//  [cell.contentView addSubview:yearLabel];
//  [yearLabel release];

//}
// UILabel *priceLabel1=(UILabel*)[cell.contentView viewWithTag:PriceTag];
// priceLabel1.text=[priceList objectAtIndex:indexPath.row];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜