我正在处理自定义单元格,当我在 iOS 5 模拟器上测试时一切正常,但是当我在 iOS 4 模拟器上检查时出现问题。单元格背景图像的不透明度不起作用
这是在 iOS 4 上
这是在 iOS 5 上,我希望它看起来像在 iOS 4 上
我正在使用的方法是
-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"TabelCellEb.png"]];
cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"TabelCell.png"]];}
在viewDidLoad
表格背景中是
self.tableView.backgroundColor = [UIColor clearColor];
self.parentViewController.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"TableBackground.png"]];
知道如何解决这个问题吗?
更新:这是我正在使用的单元格 BG 图像
它对它有影响,不透明度为 %30
更新2:
新图像
现在背景图像在替换为该代码后随着表格上下移动
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"TableBackground.png"]];