如何使下面为空的单元格具有与表格中第一项不透明度相同的背景颜色?我也希望保留我的圆角但是在这些空单元格上获得背景颜色时会出现问题,同时保持表格不透明以查看背景。
- (void)viewDidLoad {
self.itemsTableView.layer.cornerRadius = 5;
[super viewDidLoad];
}
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)tableCell forRowAtIndexPath:(NSIndexPath *)indexPath {
UIView* myBackgroundView = [[UIView alloc] initWithFrame:CGRectZero];
myBackgroundView.backgroundColor = [UIColor blackColor];
myBackgroundView.opaque = NO;
myBackgroundView.alpha = 0.7;
tableCell.backgroundView = myBackgroundView;
tableCell.opaque = NO;
tableCell.alpha = 0.7;
}