在表格视图填充图像的2个数据为iPhone

问题描述:

我有一个PNG显示2个单元格的值数据,如让我们说的家和地址,但我不知道如何显示他们在2个单元格中,如上部单元格将是家庭和底部会是地址在表格视图填充图像的2个数据为iPhone

现在我的形象在1个单元压缩后只有我不能继续为第二小区的任何想法

switch(indexPath.section) 
    { 

      // cell.detailTextLabel.text 
     case 0: 

      labela = (UILabel *)[cell viewWithTag:0]; 
      //labela.font = [UIFont systemFontOfSize:14]; 
      labela.textColor = [UIColor whiteColor]; 
       [labela setFont:[UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]]]; 
      labela.text = [NSString stringWithFormat:@"%@", aBook.name]; 

      cell.text = labela.text; 

      //cell.text=aBook.cuisine; 
      cell.imageView.image = [UIImage imageNamed:@"hamburger-icon.png"]; 

      //cell.imageView.image = [UIImage imageNamed:@"Health and BeautyCell.png"]; 
      ///[labela release]; 
      NSLog(@" BUTTON IS DOWN and GALLERY is working "); 
      //cell.imageView.image = [UIImage imageNamed:@"Health and BeautyCell.png"]; 
      **cell.backgroundView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"CardView.png"]] autorelease];** // this image i want to display on both 0 , 1 case 

      break; 
     case 1: 



      label = (UILabel *)[cell viewWithTag:0]; 
      [label setFont:[UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]]]; 
      //label.font = [UIFont systemFontOfSize:14]; 
      label.textColor = [UIColor whiteColor]; 
         label.text = [NSString stringWithFormat:@"%@", aBook.address]; 
      cell.imageView.image = [UIImage imageNamed:@"home-icon.png"];//ChildSeat notes-icon.png 



      break; 
     case 2: 

有没有办法可以跨越一个小区来回两行。我给你两个选择:

  1. 斯普利特图像中的两个 部分手动,并把它们合并到一列 两行
  2. 把图像转换成一排(使用- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath方法来设置的高度该行)并手动创建一个内容单元格,该内容单元格将包含两个文本输入,然后将两个文本输入符合所提供的图像。

我个人比较喜欢第一种情况。

+0

嗯,谢谢,但我看到一些人这样做?我有一个PNG有所有3个单元格的信息。他们怎么做:( – ram 2010-07-26 14:25:43

+0

他们可能已经裁剪了PNG的代码。这很容易做到与图像类 – ULysses 2010-07-26 14:31:42

+0

任何代码:(如何裁剪图像PLZ显示我 – ram 2010-07-26 14:39:01