可以给tableview添加一个背景图片吗??  如何添加 求代码!!!!~

解决方案 »

  1.   

    UITableView 是从 UIView 继承下来的,可以试试直接设置 backgroundColor。从图片创建一个 UIColor,使用 Pattern 方式初始化。
    另外,就是在下面增加一层图片,将表格的背景色设置为透明。
      

  2.   

    最好重写 这个函数
    -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{    cell.backgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"58rowWrap.png"]];   //cell的背景图
        cell.textLabel.backgroundColor = [UIColor clearColor];
    }
      

  3.   

    看错了 以为是给cell添加背景图
     给tableView  直接这样UIImageView *tableBg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"XXX.png"]];
        [yourTable setBackgroundView:tableBg];
        [tableBg release];
      

  4.   

    楼上的好熟练啊,能问下搞iPhone多就了么?
      

  5.   

     我学iPhone一个星期
      

  6.   

    another way....1) place the background image first and then place the tableview on view;
     
    2) code : set tableView.backgroundColor = [UIColor cleanColor]; you will see the background image now...
     
      

  7.   

    1,直接修改UITableView的背景View,并且将cell背景设为透明
    2,自定义cell
    3,自定义或修改UITableView类……
      

  8.   

    可以的,什么view都可以加背景
      

  9.   

        self.tableView.backgroundColor=[UIColor clearColor];
        UIImageView *imageview = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"home_bg.png"]];
        [self.tableView setBackgroundView:imageview];
        [imageview release];