alpha
の に変更する必要がありselectedBackgroundView
ますUITableViewCell
。だから私は次のことをします:
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;
}
セルは赤色で選択されていますが、アルファ設定は bgView には影響しません。