I need to change alpha
for the selectedBackgroundView
of the UITableViewCell
. So I do the following:
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
UIView *bgView = [UIView new];
bgView.backgroundColor = [UIColor redColor];
bgView.alpha = 0.5;//This setting has no effect
cell.selectedBackgroundView = bgView;
}
Cell selected in red color, but alpha settings has no effect for bgView.