IOS开发之TableView以及TableViewCell背景设置

来源:互联网 发布:java 跨域请求 编辑:程序博客网 时间:2024/05/16 16:21
TableViewCell背景设置


-(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];
}

 

TableView背景设置

 

UIImageView *tableBg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"XXX.png"]];
[yourTable setBackgroundView:tableBg];
[tableBg release];

原创粉丝点击